16.3.3 ORA-12170

Indicates that the connection failed with a timeout, such as Transmission Control Protocol (TCP) connect timeout, Outbound connect timeout, or Receive timeout.

Message

ORA-12170: Cannot connect. 
string timeout of string for string.
(CONNECTION_ID=string)

For example:

TCP-level connect timeout:
ORA-12170: Cannot connect. 
TCP connect timeout of 30s for host 10.9.7.5 port 1522. 
(CONNECTION_ID=1ABcDEabCd1aB+AbCdE1aB==)
Outbound connect timeout:
ORA-12170: Cannot connect. 
Outbound connect timeout of 30s for host 10.9.7.5 port 1522. 
(CONNECTION_ID=1ABcDEabCd1aB+AbCdE1aB==)
Receive timeout:
ORA-12170: Cannot connect. 
Receive timeout of 30s for host 10.9.7.5 port 1522. 
(CONNECTION_ID=1ABcDEabCd1aB+AbCdE1aB==)

Cause

The connection request cannot be completed within the allotted time interval. This may be a result of network or system delays, or may indicate a denial-of-service (DoS) attack on the database server.

Action

  • If the error occurred in your application, then perform these tasks:
    1. If you have used the CONNECT_TIMEOUT or TRANSPORT_CONNECT_TIMEOUT parameters in an Easy Connect or tnsnames.ora connection string, then set these parameters to a larger value.

      Alternatively, set one or all of these parameters in the client sqlnet.ora file to a larger value:
      • SQLNET.OUTBOUND_CONNECT_TIMEOUT

      • SQLNET.RECV_TIMEOUT

      • TCP.CONNECT_TIMEOUT

      The connection string parameters take precedence over the corresponding sqlnet.ora parameters.

    2. In the languages that support programmatic driver settings, adjust the settings equivalent to your specified timeout parameter values.

      For example:

      With JDBC, adjust oracle.net.OUTBOUND_CONNECT_TIMEOUT, oracle.net.CONNECT_TIMEOUT, or use setLoginTimeout().

      With Python, python-oracledb, adjust the tcp_connect_timeout parameter when calling connect() or create_pool().

  • If the error occurred in the database alert log file, then set one or both of these parameters in the database sqlnet.ora file to a larger value:
    • SQLNET.INBOUND_CONNECT_TIMEOUT

    • SQLNET.RECV_TIMEOUT

  • If you suspect a malicious client, then use the database alert log to identify the source address and then restrict the access.

  • Use the CONNECTION_ID value to track this connection attempt in trace files for further diagnosis.