// Oracle error reference

ORA-12170: TNS: connect timeout occurred

The client gave up waiting to connect: the host is unreachable, a firewall silently drops the traffic, or the server was too slow to respond.

Error code
ORA-12170
Category
Connection and login
Error message
TNS:Connect timeout occurred

What it means

ORA-12170 means the connection attempt didn't complete in time. Unlike ORA-12541, nothing refused the connection; the packets went unanswered. That points at the network: a wrong IP address, routing, or a firewall that drops rather than rejects.

Newer releases add detail: Cannot connect. timeout_type timeout of timeout for host_port., naming which timeout fired.

Common causes

  • A firewall or security group dropping traffic to the listener port.
  • A wrong or unreachable host address, for example a private IP from outside the network.
  • A very slow or overloaded server or network, with a short SQLNET.OUTBOUND_CONNECT_TIMEOUT or CONNECT_TIMEOUT.

How to fix it

  1. Test reachability from the client machine: nc -vz db-host 1521 or tnsping. If it hangs, it's the network path.

  2. Open the listener port in every firewall between client and server, including cloud security groups.

  3. If the network is just slow, raise the connect timeout in the client's sqlnet.ora (SQLNET.OUTBOUND_CONNECT_TIMEOUT) or the descriptor's CONNECT_TIMEOUT.

Related errors

More connection and login errors

The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.

// fewer errors, faster fixes

Work on Oracle in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Oracle and the other databases you use.