有两台服务器,windows7和oracle enterprise linux 5.7,上面都装有oracle 10.2.1,现在要在上面做物化视图实验并建dblink,所以需要创建服务名,两节点的tnsnames.ora中都加有如下代码:
WIN7 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.35)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = newdb)
)
)
OEL5 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.84)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = oel)
)
)
在windows7上tnsping的结果:
C:\Users\mdu>tnsping win7
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 30-8月 -
2012 14:12:35
Copyright (c) 1997, 2005, Oracle. All rights reserved.
已使用的参数文件:
E:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 192.168.0.35)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = newdb)))
OK (20 毫秒)
C:\Users\mdu>tnsping oel5
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 30-8月 -
2012 14:12:41
Copyright (c) 1997, 2005, Oracle. All rights reserved.
已使用的参数文件:
E:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 192.168.0.84)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = oel)))
OK (20 毫秒)
在linux上tnsping的结果:
[oracle@oel5 ~]$ tnsping win7
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 30-AUG-2012 14:13:26
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.35)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = newdb)))
TNS-12535: TNS:operation timed out ############ 很奇怪,反过来就ping不通了,怪不得建的dblink连不上!
[oracle@oel5 ~]$ tnsping oel5
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 30-AUG-2012 14:13:21
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.84)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = oel)))
OK (20 msec)
最后查了N多资料看了N多个案例,才找到根本原因,我的windows 防火墙没有关,关掉之后一切都ok了!
高级复制之路上的插曲----谨以记之!
转载于:https://blog.51cto.com/chinadm123/977467