CONNECT_RETRIES environment variable

The CONNECT_RETRIES environment variable sets a limit on the maximum number of connection attempts that can be made to each database server by the client after the initial connection attempt fails. These attempts are made within the time limit that the CONNECT_TIMEOUT setting specifies.


1  setenv CONNECT_RETRIES count
count
The number of additional attempts to connect to each database server after the initial connection attempt fails.
For example, the following command sets CONNECT_RETRIES to specify three connection attempts after the initial attempt:
setenv CONNECT_RETRIES 3

The default value for CONNECT_RETRIES is one attempt after the initial connection attempt.

Order of precedence among CONNECT_RETRIES settings

When you specify a setting for the CONNECT_RETRIES client environment variable, it overrides any CONNECT_RETRIES configuration parameter setting in the onconfig file.

If the SET ENVIRONMENT statement specifies a setting for the CONNECT_RETRIES session environment option, however, the SQL statement setting overrides the CONNECT_RETRIES client environment variable setting for subsequent connection attempts during the current session. The SET ENVIRONMENT CONNECT_RETRIES setting has no effect on other sessions.

In summary, this is the ascending order (lowest to highest) of the methods for setting a limit on attempts for a connection to a database server:

  • CONNECT_RETRIES configuration parameter
  • CONNECT_RETRIES client environment variable
  • SET ENVIRONMENT CONNECT_RETRIES statement of SQL

The CONNECT_TIMEOUT setting takes precedence over the CONNECT_RETRIES setting. Connection attempts can end after the CONNECT_TIMEOUT value is exceeded, but before the CONNECT_RETRIES value is reached. For more information about restricting the time available to establish a connection to a database server, see CONNECT_TIMEOUT environment variable