Skip to content
Home » Oracle » Why Tnsping Hang

Why Tnsping Hang

sqlplus, tnsping or lsnrctl Hangs

I can't cover all situations in this post, but I have some cases to share with you. Those hanging all point to one problem: Domain name resolution.

  1. Does the database server use DNS to do name resolution?
  2. Sometimes, DNS traps the name resolution in an unknown and indefinite loop until timeout, say, 10 minutes. You can do one of these actions:

    • Switch to another DNS or use /etc/hosts file directly.
    • Use IP address instead of hostname in tnsnames.ora or listener.ora and then bounce the listener.

  3. Is the hostname of database server correct?
  4. If the hostname was erroneously set after some critical failures, the name resolution would be stuck in looking for the unknown name. I had ever faced this case. Please check the following items:

    • Is there any typo in hostname that you provided in name servers, /etc/hosts, tnsnames.ora or listener.ora?
    • Is hostname case sensitive in your case? I know name resolution is essentially case insensitive, but in some cases, you should take care of it.

Please notice that, long waits also occur at logging on a database with whatever tools, users may complain about the waits.

Even though slow responses may eventually bring the correct results after several minutes, but it's not normal after all.

For more network troubleshooting on database servers, you may refer to this post:

  1. TNSPING, How and Why
  2. How to Resolve The listener supports no services

Leave a Reply

Your email address will not be published. Required fields are marked *