Tnsping,ociping,adbpingi,connping

Ping Checks Life, tnsping Checks Purpose #JoelKallmanDay

Before I start, I want to explain.

Joel Kallman was a professional whose life was dedicated to databases and one of the co-creators of Oracle Application Express. With a career spanning several decades, he made significant contributions to database development and management. He passed away from COVID-19 on May 25, 2021.

Since 2016, there has been an Oracle Community Day where bloggers share content on the same day to create a sense of community buzz. The name of the event has changed over the years, but in 2021, it was renamed “Joel Kallman Day.” This year, it will be held on Wednesday, October 15th. The details of how it works are explained in Tim Hall’s blog post.

When a client can’t connect to an Oracle database, the first question we ask is:

“Where is the connection failing?”

Oracle provides several utilities to help us find the answer: from simple network reachability tests to advanced client-layer diagnostics.
Let’s explore ping, tnsping, ociping, and adping with practical examples.

Ping is an OS-level utility that checks whether the host is reachable over the network (typically via ICMP). It does not test Oracle connectivity, only basic TCP/IP reachability.

If ping fails, the problem is below Oracle’s networking layer : possibly DNS, routing, or firewall.

For a better network performance, the private interconnect is configured to use jumbo frames, typically with an MTU (Maximum Transmission Unit) size of 9000 bytes instead of the default 1500. Even when standard ping works fine, communication problems may occur if the network isn’t properly configured for jumbo frames (for example, if an intermediate switch doesn’t support them).
In such cases, you can test with a custom packet size using ping.

Explanation:

  • -s specifies the ICMP payload size (not including headers).
  • -M do tells ping not to fragment the packet — ensuring the full frame size is supported end-to-end.
  • The total frame size = payload (-s) + 28 bytes (IP + ICMP headers).
  • So -s 1472 → 1500-byte frame, and -s 8972 → 9000-byte frame.

If you see an error like:

ping: local error: Message too long, mtu=8972

It means jumbo frames are not correctly configured somewhere along the path.

tnsping is an Oracle utility that tests whether a client can reach the listener specified in a TNS alias or connection string. It uses the TNS protocol (TCP/1521 by default), not ICMP.

What it tests:

  • DNS resolution of the host name
  • Network connectivity to the listener port
  • Listener’s availability to accept connections

What it does not test:

  • Database service availability
  • User authentication

It’s important to understand that an “OK” message from tnsping does not guarantee that the SERVICE_NAME you specified actually exists on the target database.

tnsping only tests the ability to reach the listener process on the host and port defined in the TNS entry.
It doesn’t verify whether the service name (in CONNECT_DATA=(SERVICE_NAME=...)) is registered with that listener.

If tnsping works but a SQL*Plus connection fails, the issue is likely inside the listener or the database service.

Even though the service name bjk does not exist in the database, tnsping still returns:

OK (10 msec)

That’s because tnsping stops testing after successfully reaching the listener, it doesn’t ask the listener to resolve or validate the service name.

To truly verify the service’s existence, use SQL*Plus or a direct connection:

This tool is published by Oracle’s Real-World Performance Team, of which I’m a big fan for their outstanding work. You can also find some of their fascinating videos on the Oracle Learning Channel on YouTube. You may refer to Github Page(Measuring Oracle Net Latency) and Ociping Manual for details. It requires an Oracle Client installation to run.

The ociping tools makes one log on to a database , and then runs OCIPing() once per second for some period, showing the time for each roundtrip. The output is somewhat similar to the standard Linux ‘ping’ utility. By default, the tool runs for 60 seconds, and at completion, the average and standard deviation is shown. This tool is good in “stable” environments with little latency variation and has the benefit of showing lots of OCIPing on a single database connection.

A sample call using a URL style connect string and the resulting output is:

This tool is also published by Oracle’s Real-World Performance Team. You may refer to Github Page(Measuring Oracle Net Latency) for details. It requires an Oracle Client installation to run.

The connping tool has a few differences to the ociping tool, most importantly that it does not only establish one database connection initially, instead it will establish a new database connection every second and subsequently use that database connection to perform the OCIPing() call. Additionally, it will also execute a very simple ‘select 1 from dual’ query. The time to do all three: Logon to the database, do OCIPing() and do the query is output. By default, connping runs for 60 seconds and it shows the averages and standard deviation of all three at the end.

A sample call in this case using an alias from tnsnames.ora and the resulting output is:

If you have an environment where network performance varies, you may need to run connping and/or ociping multiple times to get complete understanding.

adbping is an easy to use command line tool that can easily help end users determine the connection and SQL execution latency to benchmark the performance outside of their business workload. Tool is feature rich, allowing users to run the benchmark test with multitude of options including multi client support, multi threaded, configurable connection characteristics like pool size and other options.

More information, setup instructions, and command options are available on the “Connection and latency test tool – adbping (Doc ID 2863450.1)

Example Usage:

Hope it helps.


Discover More from Osman DİNÇ


Comments

Leave your comment