今天在linux搭建的IPV6环境下重新启动了一下oracle,在启动listener时得到如下的输出:
LSNRCTL> start
Starting /oracle/11g/bin/tnslsnr: please wait
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /oracle/11g/network/admin/listener.ora
Log messages written to /oracle/diag/tnslsnr/node2/listener/alert/log.xml
Trace information written to /oracle/diag/tnslsnr/node2/listener/trace/ora_8028_3086591680.trc
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node2)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=node2)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 06-JAN-2010 13:07:43
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level admin
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/11g/network/admin/listener.ora
Listener Log File /oracle/diag/tnslsnr/node2/listener/alert/log.xml
Listener Trace File /oracle/diag/tnslsnr/node2/listener/trace/ora_8028_3086591680.trc
Listening Endpoints Summary
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node2)(PORT=1521)))
The listener supports no services
The command completed successfully
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=node2)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
根据提示listener在start后,显示启动成功,但是查看状态时报错,随即分析了Listener的日志,并且将listener的trace level设定为了admin,也无法定位问题。
随后,在google进行搜索,发现在linux下出现listener相关的问题,有很大部分是和/etc/hosts的配置有关,特别是其中一篇提到在/etc/hosts 中没有设定 127.0.0.1,会产生错误,的确在这个IPV6的环境中,已经将127.0.0.1从/etc/hosts,替换为::1,在/etc/hosts恢复了127.0.0.1的配置,问题解决。不知这个问题是否oracle的一个缺陷?特别是启动的提示太有误导了,一点提示都找不到