停止指定监听:lsnrctl stop
启动指定监听:lsnrctl start
杀掉指定监听进程:kill -9 进程ID
监听状态:lsnrctl status --Status命令显示监听器是不是活动的,日志与跟踪文件的位置,监听器已经持续运行了多长时间,以及监听器所监听的任务。
[tmdata2:smis:/home/smis]lsnrctl status
LSNRCTL for HPUX: Version 10.2.0.1.0 - Production on 11-SEP-2009 09:45:59
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tmdata2)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias(别名) LISTENER
Version TNSLSNR for HPUX: Version 10.2.0.1.0 - Production
Start Date 25-AUG-2009 11:28:56
Uptime(启动日期) 16 days 22 hr. 17 min. 2 sec
Trace Level(跟踪级别) off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/product/10.2.0/db_1/network/admin/listener.or
Listener Log File /oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tmdata2)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl_XPT" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[tmdata2:smis:/home/smis]services lsnr_hndw
sh: services: Execute permission denied.
lsnrctl services --列举监听器的服务信息,比如这些服务是否有任何专用的预生成服务器进程或与之相关的调度进程,以及每个服务已有多少连接被接受或拒绝。这种方法用来检查一个监听器是否在监听一个指定服务。列出服务的一个汇总表及为每个协议服务处理程序所建立和拒绝的连接信息个数。
version --显示oracle net软件与协议适配器的版本
reload --重新装入监听器,重新读取listener.ora文件,但不关闭监听器。如果该文件发生了变化,重新刷新监听器。
change_config --当从lsnrctl工具中对listener.ora文件进行了修改时,复制一个叫做listener.bak的listener.ora的文件
trace --打开监听器的跟踪特性
quit --退出lsnrctl实用工具
exit --退出lsnrctl实用工具
set*
password --指定在lsnrctl命令行工具中执行管理任务所需要的密码
rawmode
displaymode
trc_file --指定监听器跟踪信息的位置。默认设置是$ORACLE_HOME\network\trace\listener.trc
trc_directory
trc_level --跟踪级别
OFF --未启用跟踪功能。OFF 为默认设置。
USER --将跟踪设置为用户的相应级别。跟踪以标识用户导致的错误条件。
ADMIN --将跟踪设置为数据库管理员的相应级别。跟踪以标识特定的安装问题。
SUPPORT --将跟踪设置为客户支持人员的相应级别。 跟踪文件可能会变得很大。
Oracle Corporation --建议在不进行网络问题诊断时关闭跟踪功能。
log_file
指定一个监听器将把日志信息写到哪里。这个参数在默认的情况下是ON,并默认为%oracle_home%\network\log\listener.log
log_directory
log_status
current_listener
inbound_connect_timeout
定义监听器在一个会话得到启动时将等待的有效响应时间。默认设置为10秒。
startup_waittime
定义监听器在响应lsnrctl命令行工具中的一条status命令之前将等待多长时间。
save_config_on_stop
指定在一个lsnrctl会话期内所发生的修改在退出时是否应该被保存起来。
show*
rawmode
显示关于status和service的较详细信息(当他们设置成on时)值为ON或OFF
displaymode
把lsnrctl工具的显示模式设置成raw、compact、normal或verbose
服务显示模式为NORMAL
rules
trc_file
指定监听器跟踪信息的位置。默认设置是$ORACLE_HOME\network\trace\listener.trc
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=linux)(PORT=3521)))
listener2 参数 \trc_file\ 被设为 listener2.trc
命令执行成功
trc_directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=130.76.1.41)(PORT=3521))
)
lsnr_hndw parameter "trc_directory" set to /oracle/app/oracle/product/920/networ
k/trace/
The command completed successfully
trc_level
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=130.76.1.41)(PORT=3521))
)
lsnr_hndw parameter "trc_level" set to off
The command completed successfully
log_file
指定一个监听器将把日志信息写到哪里。这个参数在默认的情况下是ON,并默认为%oracle_home%\network\log\listener.log
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=130.76.1.41)(PORT=3521))
)
lsnr_hndw parameter "log_file" set to lsnr_hndw.log
The command completed successfully
log_directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=130.76.1.41)(PORT=3521))
)
lsnr_hndw parameter "log_directory" set to /oracle/app/oracle/product/920/networ
k/log/
The command completed successfully
log_status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=130.76.1.41)(PORT=3521))
)
lsnr_hndw parameter "log_status" set to ON
The command completed successfully
current_listener
目前的监听器为 listener2
inbound_connect_timeout
定义监听器在一个会话得到启动时将等待的有效响应时间。默认设置为10秒。
$ oerr ora 12525
12525, 00000, "TNS:listener has not received client's request in time allowed"
// *Cause: The listener disconnected the client because the client failed to
// provide the necessary connect information within the allowed time interval.
// This may be a result of network/system delays; or this may indicate that a
// malicious client is trying to cause a Denial of Service attack on the
// listener.
// *Action: If the error occurred because of a slow network/system,
// reconfigure INBOUND_CONNECT_TIMEOUT to a larger value. If a malicious
// client is suspected, use the address in listener.log to identify the
// source and restrict access. Turn on tracing for more information.
// *Comment: The logged address in listener.log may not be reliable as it
// can be forged at the lower networking layers (e.g. in the case of TCP/IP).
startup_waittime
定义监听器在响应lsnrctl命令行工具中的一条status命令之前将等待多长时间。
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=linux)(PORT=3521)))
listener2 参数 \startup_waittime\ 被设为 0
命令执行成功
nbound_connect_timeout
定义监听器在一个会话得到启动时将等待的有效响应时间。默认设置为10秒。
$ oerr ora 12525
12525, 00000, "TNS:listener has not received client's request in time allowed"
// *Cause: The listener disconnected the client because the client failed to
// provide the necessary connect information within the allowed time interval.
// This may be a result of network/system delays; or this may indicate that a
// malicious client is trying to cause a Denial of Service attack on the
// listener.
// *Action: If the error occurred because of a slow network/system,
// reconfigure INBOUND_CONNECT_TIMEOUT to a larger value. If a malicious
// client is suspected, use the address in listener.log to identify the
// source and restrict access. Turn on tracing for more information.
// *Comment: The logged address in listener.log may not be reliable as it
// can be forged at the lower networking layers (e.g. in the case of TCP/IP).
startup_waittime
定义监听器在响应lsnrctl命令行工具中的一条status命令之前将等待多长时间。
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=linux)(PORT=3521)))
listener2 参数 \startup_waittime\ 被设为 0
命令执行成功 |