为你的Listener加个password

为你的Listener加个password

上一篇 / 下一篇  2007-12-17 10:09:24 / 个人分类:Oracle数据库技术-数据库管理

一般我们都是可以给所属的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/14245958/viewspace-416202/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/14245958/viewspace-416202/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值