/etc/hosts 文件引起的监听无法启动的处理过程

简介:
     新装了1个11.2的oracle数据库,配置监听时总是无法启动,最后发现竟然是hosts文件的原因,下面详细信息。
1.启动监听:
[oracle@chenbo ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 12-JAN-2011 15:12:46
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
Starting /u01/app/oracle/ora11gR2/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/ora11gR2/diag/tnslsnr/chenbo/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.150.1)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.150.1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                12-JAN-2011 15:12:46
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/ora11gR2/diag/tnslsnr/chenbo/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.150.1)(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
 
2.查看监听状态,却提示没有监听服务启动。
[oracle@chenbo dbs]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 12-JAN-2011 15:30:16
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.150.1)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
   
3.查看监听日志:
   
[oracle@chenbo ~]$ tail -f /u01/app/oracle/ora11gR2/diag/tnslsnr/chenbo/listener/trace/listener.log
Trace information written to /u01/app/oracle/ora11gR2/diag/tnslsnr/chenbo/listener/trace/ora_20443_47949057950496.trc
Trace level is currently 0
Started with pid=20443
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.150.1)(PORT=1521)))
Listener completed notification to CRS on start
TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
WARNING: Subscription for node down event still pending
12-JAN-2011 14:25:47 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=chenbo)(USER=oracle))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=186646784)) * status * 0
Wed Jan 12 14:29:26 2011
System parameter file is /u01/app/oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/ora11gR2/diag/tnslsnr/chenbo/listener/alert/log.xml
Trace information written to /u01/app/oracle/ora11gR2/diag/tnslsnr/chenbo/listener/trace/ora_20479_47689240552224.trc
Trace level is currently 0

可以看到监听在启动的时候去读取了系统的主机名chenbo和登陆的用户oracle,因此这个主机名gaojf应该在/etc/hosts中唯一存在的,并且对oracle用户是可以使用的,
  
4.查看hosts文件,
[oracle@chenbo ~]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               chenbo
192.168.150.1           chenbo
#::1            localhost6.localdomain6 localhost6
 
5.刚开始尝试屏蔽 127.0.0.1行,重新启动服务器后,启动监听,还是错误。
后来修改127.0.0.1的机器名为localhost,如下:
[oracle@chenbo dbs]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost
192.168.150.1           chenbo
# ::1           localhost6.localdomain6 localhost6

6.再次启动监听,可以看到已经成功启动了。
[oracle@chenbo dbs]$ lsnrctl start
[oracle@chenbo dbs]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 12-JAN-2011 16:03:34
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.150.1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                12-JAN-2011 15:43:47
Uptime                    0 days 0 hr. 19 min. 47 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/ora11gR2/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/ora11gR2/diag/tnslsnr/chenbo/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.150.1)(PORT=1521)))
Services Summary...
Service "orcl" has 2 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
 


本文转自 gjm008 51CTO博客,原文链接:http://blog.51cto.com/gaoshan/477281,如需转载请自行联系原作者
相关文章
|
22天前
|
Ubuntu Linux
linux启动与关闭日志
Linux系统中的日志文件分布在多个位置,如`/var/log/syslog`或`/var/log/messages`(含系统事件)、`/var/log/boot.log`(启动详情,非所有发行版都有)、`/var/log/dmesg`(内核启动消息)、`/var/log/auth.log`(身份验证记录)和`/var/log/lastlog`(用户登录信息)。对于使用systemd的发行版,可利用`journalctl`命令进行日志查询。查看日志文件可借助文本编辑器或命令行工具如`tail`和`grep`。访问日志文件可能需要权限,可能需使用`sudo`或root用户。
27 0
|
6月前
|
Windows
远程更新windows服务上hosts文件
远程更新windows服务上hosts文件
86 0
|
网络协议 网络安全 数据安全/隐私保护
FileZilla Server目录显示失败的处理方法
FileZilla Server目录显示失败的处理方法
505 0
FileZilla Server目录显示失败的处理方法