Press "Enter" to skip to content

ORACLE LSNRCTL密码及忘记密码处理

Oracle lsnrctl设置密码

如何给监听器设置密码,提防被其他用户关掉监听器?以下是给监听器设置密码的步骤: 
进入LSNRCTL: 
1、设置监听器的口令.默认口令为空. 
LSNRCTL> change_password 
Old password: 
New password: Reenter new password: 
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vecentli)(PORT=1521))) 
LISTENER的口令已更改命令执行成功 
LSNRCTL> 
=============================================================================
2、设置session级别的密码,如果密码错误,不报错,也显示”命令执行成功”,但不能停止监听器. 
LSNRCTL> set password 
Password:命令执行成功
=============================================================================
3、保存到配置文件,否则下次登陆,以前设置的密码无效. 
LSNRCTL> save_config 
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vecentli)(PORT=1521)))保存的LISTENER配置参数。 
监听器参数文件 D:\oracle\ora92\network\admin\listener.ora 
旧的参数文件D:\oracle\ora92\network\admin\listener.bak 
命令执行成功 
LSNRCTL>exit

忘记密码怎么办?

我现在的情况是:原来对listener设过密码,可忘了密码了,而listener.ora文件已被修改,listener是已经启来的。这时我在本机既不能查看状态
(status),也不能stop后按新的listener.ora文件启动。不论我是到别的环境的instance,设置一个新的密码,然后cp listener.ora过来;还是直接把加密 的那一段删除,都是一样的情况。
[oracle@qadb admin]$ /u01/app/oracle/product/9.2.0.4/bin/lsnrctl 
LSNRCTL for Linux: Version 9.2.0.4.0 – Production on 01-JUN-2006 09:22:39 
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved. 
Welcome to LSNRCTL, type “help” for information. 
LSNRCTL> status 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC))) 
TNS-01169: The listener has not recognized the password 
LSNRCTL> set password 
Password: 
The command completed successfully 
LSNRCTL> status 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC))) 
TNS-01169: The listener has not recognized the password
=============================================================================
最后只有kill listener的进程,然后修改listener.ora为未设密码的状态,就正常了: 
[oracle@qadb admin]$ ps -aux |grep lsnr 
oracle 1884 0.0 0.2 14652 2132 ? S May03 0:45 /u01/app/oracle/product/9.2.0.4/bin/tnslsnr LISTENER -inherit 
oracle 17762 0.0 0.0 3588 620 pts/5 S 13:14 0:00 grep lsnr 
[oracle@qadb admin]$ kill -9 1884 
[oracle@qadb admin]$ vi listener.ora

LISTENER.ORA Network Configuration File: /u01/app/oracle/product/9.2.0.4/network/admin/listener.ora
Generated by Oracle configuration tools.
LISTENER = 
(DESCRIPTION_LIST = 
(DESCRIPTION = 
(ADDRESS_LIST = 
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) 
) 
(ADDRESS_LIST = 
(ADDRESS = (PROTOCOL = TCP)(HOST = qadb)(PORT = 1521)) ) 
) 
) 
SID_LIST_LISTENER = 
(SID_LIST = 
(SID_DESC = 
(SID_NAME = PLSExtProc) 
(ORACLE_HOME = /u01/app/oracle/product/9.2.0.4) 
(PROGRAM = extproc) 
) 
(SID_DESC = 
(GLOBAL_DBNAME = unicode.meetexpo) 
(ORACLE_HOME = /u01/app/oracle/product/9.2.0.4) 
(SID_NAME = unicode) 
) 
) 
~ 
“listener.ora” 30L, 700C written 
[oracle@qadb admin]$ /u01/app/oracle/product/9.2.0.4/bin/lsnrctl

************************************************************************
lsnrctl如果加密的话,则会在listener.ora下方增加一项: *

—-ADDED BY TNSLSNR 13-11月-2007 17:44:15— *
PASSWORDS_LISTENER = A8C7CC43E70D3C13

———————————————
将该项删除后,保存listener.ora文件,即可取消lsnrctl的加密密码;

************************************************************************

One Comment

发表评论

电子邮件地址不会被公开。 必填项已用*标注