由于/etc/hosts文件中ip与实际ip不一致所导致oracle监听器不能识别

1. 今天在连接oracle时,发现客户端始终不能连接,但客户端却能ping

[root@asm ~]# ping 192.168.1.111
PING 192.168.1.111 (192.168.1.111) 56(84) bytes of data.
64 bytes from 192.168.1.111: icmp_seq=1 ttl=64 time=2.79 ms
64 bytes from 192.168.1.111: icmp_seq=2 ttl=64 time=0.227 ms
64 bytes from 192.168.1.111: icmp_seq=3 ttl=64 time=0.342 ms

--- 192.168.1.111 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.227/1.120/2.792/1.183 ms

2. 检查服务器监听器状态

[oracle@asm admin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 26-APR-2014 10:05:15

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=asm)(PORT=1521)))
TNS-12535: TNS:operation timed out
 TNS-12560: TNS:protocol adapter error
  TNS-00505: Operation timed out

(注,我的客户端(192.168.1.110)和服务端(192.168.1.111)都为虚拟机,客户端的虚拟机从服务端复制而来,故,它们两个主机名相同,但ip不同)

3. 查看服务端/etc/hosts文件

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost
192.168.10.111   asm

发现服务端的ip居然为192.168.10.111而不是192.168.1.111,怪不得客户端不能连接服务端,居然这样修改/etc/hosts内容为

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost
192.168.1.111   asm
4. 重启服务端监听器

[oracle@asm admin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 26-APR-2014 10:06:48

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=asm)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                26-APR-2014 09:23:39
Uptime                    0 days 0 hr. 43 min. 8 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/product/db/network/admin/listener.ora
Listener Log File         /u01/app/diag/tnslsnr/asm/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=asm)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
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

至些完美解决问题

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值