tnsping not working for //SERVER:PORT/SID format

1.7k Views Asked by At

This Works

app @ [server: /u01/home/apli/app/trx/appS_Apps/appS_Apps/logs ] :/>tnsping app_test

TNS Ping Utility for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production on 08-SEP-2015 01:01:57

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

Used parameter files: /u01/home/app/oracle/product/10.2/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = monger) (Port = 1531))) (CONNECT_DATA = (SID = app_test))) OK (10 msec)

But this does not. Why?

app @ [server: /u01/home/apli/app/trx/appS_Apps/appS_Apps/logs ] :/>tnsping //monger:1531/app_test

TNS Ping Utility for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production on 08-SEP-2015 00:59:16

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

Used parameter files: /u01/home/app/oracle/product/10.2/network/admin/sqlnet.ora

TNS-03505: Failed to resolve name

app @ [server: /u01/home/apli/app/trx/appS_Apps/appS_Apps/logs ] :/>ping monger PING monger.corp.com: (10.140.2.74): 56 data bytes 64 bytes from 10.140.2.74: icmp_seq=0 ttl=255 time=0 ms 64 bytes from 10.140.2.74: icmp_seq=1 ttl=255 time=0 ms 64 bytes from 10.140.2.74: icmp_seq=2 ttl=255 time=0 ms ^C ----monger.corp.com PING Statistics---- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 0/0/0 ms

app @ [server: /u01/home/apli/app/trx/appS_Apps/appS_Apps/logs ] :/>tnsping //10.140.2.74:1531/app_test

TNS Ping Utility for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production on 08-SEP-2015 00:59:40

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

Used parameter files: /u01/home/app/oracle/product/10.2/network/admin/sqlnet.ora

TNS-03505: Failed to resolve name app @ [server: /u01/home/apli/app/trx/appS_Apps/appS_Apps/logs ] :/>

2

There are 2 best solutions below

0
On

On Windows with Oracle 12, it can be used as wanted.

tnsping host:port/servicename 

The command line forms an EZConnect Oracle SQL connection string. Note that no leading slashes used in the system name devhost.corp.company.com.

PS C:\Users\user1> tnsping devhost.corp.company.com:12021/devdb 

TNS Ping Utility for 32-bit Windows: Version 12.2.0.1.0 - Production on 14-NOV-2022 10:29:25

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

Used parameter files:
C:\Oracle\product\12.2.0\client_1\network\admin\sqlnet.ora

Used EZCONNECT adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=devdb))(ADDRESS=(PROTOCOL=TCP)(HOST=10.50.206.21)(PORT=12021)))
OK (70 msec)
0
On

tnsping is used to test yout network configuration via tnsnames.ora. I doesn't make sense to call it with ips and ports. See also here: http://docs.oracle.com/cd/E11882_01/network.112/e41945/connect.htm#NETAG357