LSNRCTL command
使用LSNRCTL中的SET,reload等命令可以动态修改listener的一些参数,而不影响客户端连接数据库。
LSNRCTL> SET CURRENT_LISTENER LISTENER2
Current Listener is LISTENER2
Current Listener is LISTENER2
当服务器上有多个数据库监听的时候,可以使用SET CURRENT_LISTENER设置要进行命令操作的监听
LSNRCTL> set
The following operations are available after set
An asterisk (*) denotes a modifier or extended command:
password rawmode
displaymode trc_file
trc_directory trc_level
log_file log_directory
log_status current_listener
inbound_connect_timeout startup_waittime
save_config_on_stop dynamic_registration
LSNRCTL> set log_file /oracle/TEST/products/10203/network/log/listener2.log
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=test.oracle.com)(PORT=1523)(SDU=8192)(TDU=8192)(QUEUESIZE=200))
LISTENER2 parameter "log_file" set to /oracle/TEST/products/10203/network/log/listener2.log
The command completed successfully
The following operations are available after set
An asterisk (*) denotes a modifier or extended command:
password rawmode
displaymode trc_file
trc_directory trc_level
log_file log_directory
log_status current_listener
inbound_connect_timeout startup_waittime
save_config_on_stop dynamic_registration
LSNRCTL> set log_file /oracle/TEST/products/10203/network/log/listener2.log
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=test.oracle.com)(PORT=1523)(SDU=8192)(TDU=8192)(QUEUESIZE=200))
LISTENER2 parameter "log_file" set to /oracle/TEST/products/10203/network/log/listener2.log
The command completed successfully
重新设置该监听的日志文件路径;当unix下误删除该日志文件,而listener仍然保持有日志文件的文件指针,磁盘空间没有被释放。此时可以使用该方法重新指定日志,释放旧日志的空间。
通过修改listener.ora文件,再reload listener 也有同样的效果。
LSNRCTL> reload LISTENER2
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=test.oracle.com)(PORT=1523)(SDU=8192)(TDU=8192)(QUEUESIZE=200))
The command completed successfully
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=test.oracle.com)(PORT=1523)(SDU=8192)(TDU=8192)(QUEUESIZE=200))
The command completed successfully