First, let’s see how we reproduce TNS-12535.
TNS Ping Utility for 64-bit Windows: Version 188.8.131.52.0 - Production on 22-JUL-2014 19:03:21
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = primary01)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = compdb)))
TNS-12535: TNS:operation timed out
TNS-12535 means the connect identifier can be found in tnsnames.ora and the hostname is resolvable by DNS or /etc/hosts, but somehow network problems make the connection timed out.
There could be several causes of TNS-12535 that I listed below.
- The hostname in the connect descriptor of compdb points to a wrong IP address.
- The port specified in the connect descriptor of compdb points to a wrong port.
- The port specified in the connect descriptor of compdb is not opened on firewall of the database server.
- DNS or /etc/hosts points to a wrong IP address while resolving domain name.
- Any other anti-virus software on clients.
- The server has been shutdown, there's no way to go.
- Inspect the content of tnsnames.ora closely once again to make sure there's no any typo or mistake.
- Check your DNS, /etc/hosts or C:\Windows\System32\drivers\etc\hosts file to make sure the IP mapping is correct. Additionally, check the format of IP mapping is correct.
- Open the port 1521.
- For iptables, you may refer to: Open Port 1521 on Linux 6 for Database Server.
- For firewalld, you may refer to: Open Port 1521 on Linux 7 for Database Server.
For more connection troubleshooting, you may refer to Oracle 18c Net Services Administrator's Guide: 15 Testing Connections.