5.1.5 Automatic Client Reroute
ACR is not tied to HADR. You can use it with HADR, clustering software, in a partitioned database environment, replication, and so on. ACR automatically and transparently reconnects DB2 database client applications to an alternate server without the application or user being exposed to a communications error. The alternate server information is stored on the primary database server, and loaded into the client's cache upon a successful connection to the primary database server. This means that for a client application to know the alternate database server, it must first successfully connect to the primary database server.
When ACR is configured, the built-in retry logic alternates between the original primary server and the alternate server for 10 minutes, or until a database connection is re-established to the primary database server.
Acquiescently, the retry logic built into ACR will:
- Try to re-establish a connection to the original primary server to ensure that there is no accidental failure.
- Alternate connection attempts between both the original primary database server and the alternate database server every 2 seconds for 30-60 seconds.
- Alternate connection attempts between both the original primary database server and the alternate database server every 5 seconds for 1-2 minutes.
- Alternate connection attempts between both the original primary database server and the alternate database server every 10 seconds for 2-5 minutes.
- Alternate connection attempts between both the original primary database server and the alternate database server every 30 seconds for 5-10 minutes.
- If no connection to the original primary database server is made after all of these attempts, the SQL30081N error code is returned to the client application.
At the same time, there are two DB2 database registry variables called DB2_MAX_CLIENT_CONNRETRIES and DB2_CONNRETRIES_INTERVAL that help to accurately configure the retry logic of ACR:
- DB2_MAX_CLIENT_CONNRETRIES defines the maximum number for a DB2 client retry to connect to the database server.
- DB2_CONNRETRIES_INTERVAL defines the interval between two different reconnection attempts.
Note: The tests in this book do not cover these two DB2 database registry variables.
For more information about ACR, see The IBM DB2 Version 8.2 Automatic Client Reroute Facility at:
http://www.ibm.com/developerworks/db2/library/techarticle/dm-0512zikopoulos/#main
xxxx