一:环境信息
主机平台:linux 6.2
数据库版本:11.2.0.3(psu5)单实例
二:问题现象
lsnrctl status查看监听状态时发现没有监听文件(Listener Parameter File,正常情况是会有监听文件信息的)
--注意因为问题库是商用库,不能把信息直接发出来。下面的内容是用测试环境模拟的
1.问题库的lsnrctl status信息
[oracle@localhost admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-APR-2014 17:47:28
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 15-APR-2014 17:25:41
Uptime 0 days 0 hr. 21 min. 47 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening 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 status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-APR-2014 17:24:56
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 15-APR-2014 17:17:16
Uptime 0 days 0 hr. 7 min. 39 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0.4/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening 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 status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-APR-2014 17:24:56
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 15-APR-2014 17:17:16
Uptime 0 days 0 hr. 7 min. 39 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0.4/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening 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 status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-APR-2014 17:47:28
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 15-APR-2014 17:25:41
Uptime 0 days 0 hr. 21 min. 47 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening 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)
lsnrctl status
[oracle@test database]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 16-APR-2014 14:00:49
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
--此时还没有监听启动
lsnrctl start
[oracle@test database]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 16-APR-2014 14:00:56
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0.3/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Log messages written to /u01/app/oracle/diag/tnslsnr/test/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 16-APR-2014 14:00:57
Uptime 0 days 0 hr. 0 min. 3 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/test/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test)(PORT=1521)))
The listener supports no services
The command completed successfully
--默认监听正常启动(监听的是主机名“test”的1521端口)
3)查看$ORACLE_HOME/network/admin下监听文件是否存在
[oracle@test ~]$ cd $ORACLE_HOME/network/admin
[oracle@test admin]$ ls -la
total 16
drwxr-xr-x 3 oracle oinstall 4096 Apr 16 13:50 .
drwxr-xr-x 11 oracle oinstall 4096 Apr 16 13:59 ..
drwxr-xr-x 2 oracle oinstall 4096 Apr 16 13:49 samples
-rw-r--r-- 1 oracle oinstall 381 Dec 17 2012 shrept.lst
--没有listener.ora文件
©著作权归作者所有:来自51CTO博客作者shaochenshuo的原创作品,如需转载,请注明出处,否则将追究法律责任
lsnrctl statusListener Parameter FORACLE数据库
共同学习,写下你的评论
评论加载中...
作者其他优质文章