Repeated TNSPING via COUNT parameter


Learn something new today about Using the TNSPING Utility to Test Connectivity from the Client—the tnsping has a count parameter.

For example,

C:\Documents and Settings\Douglas>tnsping prodsrvr 5

TNS Ping Utility for 32-bit Windows: Version 11.2.0.3.0 - Production on 07-MAR-2013 20:12:09

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

Used parameter files:
I:\app\Douglas\product\11.2.0\dbhome_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = PENRITH)(PORT = 1533))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PRODSRVR.YAOCM.ID.AU)))
OK (1420 msec)
OK (30 msec)
OK (50 msec)
OK (30 msec)
OK (30 msec)

The first ping takes 1.385 seconds longer than the average of the next four (4) pings.

For comparison,

C:\Documents and Settings\Douglas>ping penrith

Pinging PENRITH [192.168.1.7] with 32 bytes of data:

Reply from 192.168.1.7: bytes=32 time<1ms TTL=128
Reply from 192.168.1.7: bytes=32 time<1ms TTL=128
Reply from 192.168.1.7: bytes=32 time<1ms TTL=128
Reply from 192.168.1.7: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.1.7:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

So, in my case, tnsping has an average of 35ms overhead to that of ping.

If I had known this when I was investigating OEM Alerts for Network Issues, I might have realised that the first tnsping involves a DNS lookup.

To test this theory out, I use the following variant of tnsping:

tnsping "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.129)(PORT = 1533))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PRODSRVR.YAOCM.ID.AU)))" 5

The result is:


TNS Ping Utility for 32-bit Windows: Version 11.2.0.3.0 - Production on 07-MAR-2013 21:05:40

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

Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.129)(PORT = 1533))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PRODSRVR.YAOCM.ID.AU)))
OK (20 msec)
OK (20 msec)
OK (20 msec)
OK (30 msec)
OK (20 msec)

Now, we have an average response time of 22ms.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s