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.
- Does the database server use DNS to do name resolution?
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.
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: