一:环境信息主机平台:linux6.2数据库版本:11.2.0.3(psu5)单实例二:问题现象lsnrctlstatus查看监听状态时发现没有监听文件(ListenerParameterFile,正常情

一:环境信息

主机平台:linux 6.2

数据库版本:11.2.0.3(psu5)单实例

二:问题现象

lsnrctl status查看监听状态时发现没有监听文件(Listener Parameter File,正常情况是会有监听文件信息的)

--注意因为问题库是商用库,不能把信息直接发出来。下面的内容是用测试环境模拟的

1.问题库的lsnrctl status信息

[oracle@localhost admin]$ lsnrctl statusLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-APR-2014 17:47:28Copyright (c) 1991, 2013, Oracle. All rights reserved.Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))STATUS of the LISTENER------------------------AliasLISTENERVersionTNSLSNR for Linux: Version 11.2.0.4.0 - ProductionStart Date15-APR-2014 17:25:41Uptime0 days 0 hr. 21 min. 47 secTrace LeveloffSecurityON: Local OS AuthenticationSNMPOFFListener Log File/u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xmlListening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))Services Summary...Service "ora11g" has 1 instance(s).Instance "ora11g", status READY, has 1 handler(s) for this service...The command completed successfully

2. 正常库的lsnrctl status信息

[oracle@localhost admin]$ lsnrctl statusLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-APR-2014 17:24:56Copyright (c) 1991, 2013, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))STATUS of the LISTENER------------------------AliasLISTENERVersionTNSLSNR for Linux: Version 11.2.0.4.0 - ProductionStart Date15-APR-2014 17:17:16Uptime0 days 0 hr. 7 min. 39 secTrace LeveloffSecurityON: Local OS AuthenticationSNMPOFFListener Parameter File /u01/app/oracle/product/11.2.0.4/db_1/network/admin/listener.oraListener Log File/u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xmlListening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))Services Summary...Service "ora11g" has 1 instance(s).Instance "ora11g", status READY, has 1 handler(s) for this service...The command completed successfully

--注意对比发现1,2的信息发现问题库的lsnrctl status信息中缺少“Listener Parameter File *****”这一行信息。 cd $ORACLE_HOME/network/admin 下发现确实没有listener.ora文件。这个问题到底是怎么出现的呢?查了MOS也没找到什么相关的信息。

三:故障模拟1

----个人猜测可能是listener.ora文件被别人误删了,所以决定从这个方面着手模拟

1. lsnrctl status(某个正常库,“Listener Parameter File”信息存在)

[oracle@localhost admin]$ lsnrctl statusLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-APR-2014 17:24:56Copyright (c) 1991, 2013, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))STATUS of the LISTENER------------------------AliasLISTENERVersionTNSLSNR for Linux: Version 11.2.0.4.0 - ProductionStart Date15-APR-2014 17:17:16Uptime0 days 0 hr. 7 min. 39 secTrace LeveloffSecurityON: Local OS AuthenticationSNMPOFFListener Parameter File /u01/app/oracle/product/11.2.0.4/db_1/network/admin/listener.oraListener Log File/u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xmlListening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))Services Summary...Service "ora11g" has 1 instance(s).Instance "ora11g", status READY, has 1 handler(s) for this service...The command completed successfully

2. 删除listener.ora文件

cd $ORACLE_HOME/network/admin

mv listener.ora listener.ora.bak

3. lsnrctl status

--同第一步中lsnrctl status信息完全相同(删除以后信息还是正常的,可能是因为监听没有重启下面我们重启监听试试)

4.重启监听

1)lsnrctl stop

2)lsnrctl start

3)lsnrctl status

[oracle@localhost admin]$ lsnrctl statusLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-APR-2014 17:47:28Copyright (c) 1991, 2013, Oracle. All rights reserved.Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))STATUS of the LISTENER------------------------AliasLISTENERVersionTNSLSNR for Linux: Version 11.2.0.4.0 - ProductionStart Date15-APR-2014 17:25:41Uptime0 days 0 hr. 21 min. 47 secTrace LeveloffSecurityON: Local OS AuthenticationSNMPOFFListener Log File/u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xmlListening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))Services Summary...Service "ora11g" has 1 instance(s).Instance "ora11g", status READY, has 1 handler(s) for this service...The command completed successfully

--问题现象重现,此时的监听信息中已没有了“Listener Parameter File”信息。

--可能大家会有疑问怎么没有listener.ora文件还能重启监听,这是因为我们用的是默认监听,,9i开始没有listener.ora也可以启动监听(默认监听)

5.还原listener.ora文件

1)mv listener.ora.bak listener.ora

2)lsnrctl status(还是没有“Listener Parameter File”信息)

3)重启监听

lsnrctl stop

lsnrctl start

4)lsnrctl status(出现“Listener Parameter File”信息)

--监听恢复正常

四:总结

9i开始不需要listener.ora文件即可启动默认监听(监听主机名所对应的ip地址的1521端口)

1)安装oracle软件(未建库)

2)启动监听(安装完oracle软件,未配置listener.ora)

09-16 20:54