TNS-12560: TNS:protocol adapter error 错误解决

环境:  数据库服务器 linux rh4 +oracle 10.2.0.4

 客户端:winxp sp2

连接数据库时报TNS-12560错误

C:\Documents and Settings\Paul Yi>tnsping asm

TNS Ping Utility for 32-bit Windows: Version 9.2.0.8.0 - Production on 07-JUL-20
08 09:45:01

Copyright (c) 1997, 2006, Oracle Corporation.  All rights reserved.

Used parameter files:
D:\oracle\ora92\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 192.168.1.206)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME =orcl)))
TNS-12560: TNS:protocol adapter error

实例采用静态注册 在服务器上运行正常

[oracle@localhost admin]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 07-JUL-2008 08:44:39

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.206)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                07-JUL-2008 08:40:31
Uptime                    0 days 0 hr. 4 min. 8 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/10.2/db/network/admin/listener.ora
Listener Log File         /oracle/10.2/db/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.206)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

[oracle@localhost admin]$ tnsping asm

TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 07-JUL-2008 08:56:12

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.206)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
OK (10 msec)
[oracle@localhost admin]$

最后想到防火墙问题 把防火墙关闭后

[root@localhost ~]# service iptables stop
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter                    [  OK  ]
Unloading iptables modules:                                [  OK  ]

C:\Documents and Settings\Paul Yi>tnsping asm

TNS Ping Utility for 32-bit Windows: Version 9.2.0.8.0 - Production on 07-JUL
08 09:52:13

Copyright (c) 1997, 2006, Oracle Corporation.  All rights reserved.

Used parameter files:
D:\oracle\ora92\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = T
(HOST = 192.168.1.206)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME =orcl)))
OK (0 msec)

正常 ,但想一下是通过默认端口1521访问的,所以允许访问服务器上的1521端口即可

 vi /etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited

改为

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1520:1523 -j ACCEPT
允许1520到1523的端口访问

[root@localhost ~]# service iptables restart
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter                    [  OK  ]
Unloading iptables modules:                                [  OK  ]
Applying iptables firewall rules:                          [  OK  ]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7199859/viewspace-374281/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7199859/viewspace-374281/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值