一般我们都是可以给所属的listener加一个密码以防止远程tns connect来关掉我们的listener
步骤是这样的:
$ lsnrctl
LSNRCTL for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production on 26-SEP-2007 19:49:08
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> set current_listener listener
Current Listener is listener
LSNRCTL> change_password
Old password:
New password:
Reenter new password:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
Password changed for listener
The command completed successfully
LSNRCTL> set password
Password:
The command completed successfully
LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
Saved LISTENER configuration parameters.
Listener Parameter File /opt/oracle/product/9.2.0.1/network/admin/listener.ora
Old Parameter File /opt/oracle/product/9.2.0.1/network/admin/listener.bak
The command completed successfully
LSNRCTL> quit
这个时候我们采用普通的暂停Listener stop的命令会发现,已经停不掉Listener了
$ lsnrctl stop
LSNRCTL for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production on 26-SEP-2007 19:50:56
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
TNS-01169: The listener has not recognized the password
这个时候我们再来观察一下我们的Listener.ora文件:
多出了这么一行:
#----ADDED BY TNSLSNR 26-SEP-2007 19:49:41---
PASSWORDS_LISTENER = 300200BB8EFECB93
#---------------------------------------------------------------------
此时如果我们想停止/启动Listener就得通过在本地运行:
$ lsnrctl
LSNRCTL for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production on 26-SEP-2
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> set password
Password:
The command completed successfully
LSNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
The command completed successfully
LSNRCTL> start
Starting /opt/oracle/product/9.2.0.1/bin/tnslsnr: please wait...
TNSLSNR for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production
System parameter file is /opt/oracle/product/9.2.0.1/network/admin/listener.ora
Log messages written to /opt/oracle/product/9.2.0.1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rmsvtp02)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for IBM/AIX RISC System/6000: Version 9.2.0.6.
Start Date 26-SEP-2007 19:53:07
Uptime 0 days 0 hr. 0 min. 2 sec
Trace Level off
Security ON
SNMP OFF
Listener Parameter File /opt/oracle/product/9.2.0.1/network/admin/listener.ora
Listener Log File /opt/oracle/product/9.2.0.1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rmsvtp02)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "irmdb" has 1 instance(s).
Instance "irmdb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>quit
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12361284/viewspace-707/,如需转载,请注明出处,否则将追究法律责任。