Loading...

Testing tns connections

This post demonstrates how to test tns connections for the Oracle DB. First of all, what is TNS? Transparent Network Substrate (TNS) is a proprietary Oracle computer networking technology that supports homogeneous peer-to-peer connectivity on top of other networking technologies such as TCP/IP, SDP and named pipes.

So if you have installed or any other Oracle DBA have setup an Oracle DB instance for you, you can check the connectivity with tnsping utility. The tnsping utility determines whether the listener for a service on an Oracle Net network can be reached successfully. It is automatically shipped within your local Oracle DB installation.

Test local connection (german output) of SID dev

C:\Users\vinh>tnsping dev
TNS Ping Utility for 64-bit Windows: Version 12.1.0.2.0 - Production on 06-NOV-2
015 08:35:24
Copyright (c) 1997, 2014, Oracle.  All rights reserved.
Parameterdateien benutzt:
C:\Daten\oracle\product\12.1.0\dbhome_1\network\admin\sqlnet.ora
Adapter TNSNAMES zur Aufl÷sung des Alias benutzt
Verbindungsversuch mit (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localho
st)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = dev)))
OK (20 ms)

Test local connection 20 times, like the JBoss Connection pooling

C:\Users\vinh>tnsping dev 20
TNS Ping Utility for 64-bit Windows: Version 12.1.0.2.0 - Production on 06-NOV-2
015 08:36:15
Copyright (c) 1997, 2014, Oracle.  All rights reserved.
Parameterdateien benutzt:
C:\Daten\oracle\product\12.1.0\dbhome_1\network\admin\sqlnet.ora
Adapter TNSNAMES zur Aufl÷sung des Alias benutzt
Verbindungsversuch mit (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localho
st)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = dev)))
OK (10 ms)
OK (20 ms)
OK (10 ms)
OK (20 ms)
OK (10 ms)
OK (20 ms)
OK (0 ms)
OK (20 ms)
OK (10 ms)
OK (20 ms)
OK (0 ms)
OK (10 ms)
OK (20 ms)
OK (0 ms)
OK (10 ms)
OK (20 ms)
OK (0 ms)
OK (10 ms)
OK (20 ms)
OK (20 ms)

Read more at http://Testing Connections - Oracle Online Help.