在测试的过程中发现,tnsping的时候总是到一个保留地址127.0.53.53上去
oracle@test1 admin]$ tnsping PROD
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 30-SEP-2014 08:42:28
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
/oinstall/product/10.2.0/db_1/network/admin/sqlnet.ora
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=PROD))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.53.53)(PORT=1521)))
OK (0 msec)
后来发现是我的文件名写错了,应该是tnsnames.ora 而我写成了tnsname.ora了。改正后,tnsping正常
[oracle@test1 admin]$ mv tnsname.ora tnsnames.ora
[oracle@test1 admin]$ tnsping PROD
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 30-SEP-2014 08:43:01
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
/oinstall/product/10.2.0/db_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.101)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = prod)))
OK (10 msec)