Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: tnsping fails, yet sqlplus connects
Lars Tetzlaff wrote:
> EdStevens wrote:
> > C:\>tnsping epspd
> >
> > TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on
> > 29-JUN-2
> > 006 09:10:21
> >
> > Copyright (c) 1997, 2005, Oracle. All rights reserved.
> >
> > Used parameter files:
> >
> As the output shows, tnsping doesn't find or use any parameter file, so
> your entry in TNSNAMES isn't used.
This is not correct. "Used parameter files:" means the sqlnet.ora file. Tnsping looks for the sqlnet.ora file first. If it cannot find it, it will go to tnsnames.ora file.... in which case you have to fully qualify the service name including the domain.
Here is a complete output. Hostname is masked only.
C:\oracle\tns_config>echo %TNS_ADMIN%
C:\oracle\tns_config
C:\oracle\tns_config>more sqlnet.ora
NAMES.DEFAULT_DOMAIN = WORLD
SQLNET.AUTHENTICATION_SERVICES = (NONE)
NAMES.DIRECTORY_PATH = (TNSNAMES)
C:\oracle\tns_config>more tnsnames.ora
D29.WORLD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = XXXXXX)(PORT = 1521))
(CONNECT_DATA = (SERVICE_NAME = D29))
)
C:\oracle\tns_config>rename sqlnet.ora sqlnet.ora.old
C:\oracle\tns_config>dir /b
snmp_ro.ora
snmp_rw.ora
sqlnet.ora.old
tnsnames.ora
C:\oracle\tns_config>tnsping d29.world
TNS Ping Utility for 32-bit Windows: Version 9.2.0.7.0 - Production on 30-JUN-2006 19:22:21 Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =
XXXXXX)(PORT = 1521)) (CONNECT_DATA = (SERVI
CE_NAME = D29)))
OK (25 msec)
C:\oracle\tns_config>tnsping d29
TNS Ping Utility for 32-bit Windows: Version 9.2.0.7.0 - Production on 30-JUN-2006 19:22:28 Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
TNS-03505: Failed to resolve name
C:\oracle\tns_config>rename sqlnet.ora.old sqlnet.ora
C:\oracle\tns_config>tnsping d29
TNS Ping Utility for 32-bit Windows: Version 9.2.0.7.0 - Production on 30-JUN-2006 19:23:35 Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
C:\oracle\tns_config\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =
XXXXXX)(PORT = 1521)) (CONNECT_DATA = (SERVI
CE_NAME = D29)))
OK (20 msec)
Regards
/Rauf
Received on Fri Jun 30 2006 - 13:28:55 CDT