关闭oracle监听

今天看到同事研究listener的password的问题,以前没怎么测试过,今天顺手来测试下.
测试的过程中,发现这么个问题,Oracle 10g,listener,本地oracle用户关闭的话,是不需要口令的了(以前版本是需要的)

Oracle 9i关闭listener是需要口令的,但start不需要.

先说说建立口令的过程[10g]:

QUOTE:

LSNRCTL> change_password
Old password:
New password:
Reenter new password:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl)(PORT=1521)))
Password changed for LISTENER
The command completed successfully
LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl)(PORT=1521)))
Saved LISTENER configuration parameters.
Listener Parameter File   /home/oracle/product/10.2.0/network/admin/listener.ora
Old Parameter File   /home/oracle/product/10.2.0/network/admin/listener.bak
The command completed successfully


配置完毕,主要为了以下2个方面:

1.防止本机的其他user,关闭listener
2.防止别人远程关闭


接下来,下面我们分别演示一下:
1.本机其他用户:

QUOTE:

[test@naonao ~]$ id
uid=502(test) gid=500(dba) groups=500(dba) context=user_u:system_r:unconfined_t
[test@naonao ~]$ lsnrctl
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 03-NOV-2006 20:52:25
Copyright (c) 1991, 2005, Oracle.  All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl)(PORT=1521)))
TNS-01190: The user is not authorized to execute the requested listener command
LSNRCTL> set password abc
The command completed successfully
LSNRCTL> stop

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl)(PORT=1521)))
The command completed successfully
LSNRCTL>


2.远程关闭

QUOTE:


[oracle@boypoo2 ~]$ lsnrctl
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 09-OCT-2006 22:00:21
Copyright (c) 1991, 2005, Oracle.  All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> set current listener1
Current Listener is listener1
LSNRCTL> set password
Password:
The command completed successfully

LSNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.232.10)(PORT=1521)))
The command completed successfully
LSNRCTL>


如若不然:

QUOTE:

[oracle@boypoo2 ~]$ lsnrctl
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 09-OCT-2006 22:02:22
Copyright (c) 1991, 2005, Oracle.  All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> set current_listener listener1
Current Listener is listener1
LSNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.232.10)(PORT=1521)))
TNS-01169: The listener has not recognized the password
TNS-01189: The listener could not authenticate the user
LSNRCTL>


还有一种情况,使用Oracle8i/9i的DBA用的到,10g的就用不到了
就是你忘记了listener密码怎么办?

解决办法:

QUOTE:

[oracle@naonao ~]$ ps -ef|grep tns
oracle    2117     1  0 10:16 ?        00:00:00 /home/oracle/product/10.2.0/bin/tnslsnr LISTENER -inherit
[oracle@naonao ~]$ kill 2117
[oracle@naonao ~]$ ps -ef|grep tns
oracle    2913  2802  0 10:19 pts/0    00:00:00 grep tns
接下来要把listener.ora中
#----ADDED BY TNSLSNR 03-MAY-2008 10:31:10---
PASSWORDS_LISTENER = CB8CC687979AB25A
#-----------------------------------------

删除或者注释,然后
[oracle@naonao ~]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 03-NOV-2006 20:59:42
Copyright (c) 1991, 2005, Oracle.  All rights reserved.
Starting /home/oracle/product/10.2.0/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /home/oracle/product/10.2.0/network/admin/listener.ora
Log messages written to /home/oracle/product/10.2.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.232.10)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=RH4SRV1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                03-NOV-2006 20:59:42
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Password or Local OS Authentication
SNMP                      OFF
Listener Parameter File   /home/oracle/product/10.2.0/network/admin/listener.ora
Listener Log File         /home/oracle/product/10.2.0/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.232.10)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
  Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@naonao ~]$

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值