Re: TNSPING for the instant client

From: Yong Huang <yong321_at_yahoo.com>
Date: Fri, 15 May 2015 07:11:57 -0700
Message-ID: <1431699117.77639.YahooMailBasic_at_web184801.mail.gq1.yahoo.com>



tnsping does more than just checking if the specified port is open on a server. It has minimum understanding of the Oracle Net protocol.

This is understandable:

c:\>tnsping "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dctrpdbms3b)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=nosuchservice)))"

TNS Ping Utility for 64-bit Windows: Version 12.1.0.2.0 - Production on 15-MAY-2015 09:07:56

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

Attempting to contact (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dctrpdbms3b)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=nosuchservice))) OK (20 msec)

It connected to my database server at port 1521, regardless what other parameters I specified. Now, let's see if it connects to SecureShell port 22, which is open:

c:\>tnsping "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dctrpdbms3b)(PORT=22)))(CONNECT_DATA=(SERVICE_NAME=nosuchservice)))"

TNS Ping Utility for 64-bit Windows: Version 12.1.0.2.0 - Production on 15-MAY-2015 09:08:01

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

Attempting to contact (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dctrpdbms3b)(PORT=22)))(CONNECT_DATA=(SERVICE_NAME=nosuchservice))) TNS-12569: TNS:packet checksum failure

The error means tnsping successfully opens the connection but fails to understand what's in the packet payload.

Of course, using nc, telnet or any such tool to check if a port is open is better than not checking at all. But if Instant Client includes sqlplus (I don't have an installation so I just assume so), you can use that too. If sqlplus is not included, you can install the lightweight 12c Sqlplus Instant Client: http://docs.oracle.com/database/121/SQPUG/apd.htm

--
http://www.freelists.org/webpage/oracle-l
Received on Fri May 15 2015 - 16:11:57 CEST

Original text of this message