Automatic client reroute description and setup (Db2 Connect server)
The main goal of the automatic client reroute feature is to enable an IBM® Data Server Client application to recover from a loss of communications so that the application can continue its work with minimal interruption. As the name suggests, rerouting is central to the support of continuous operations. But rerouting is only possible when there is an alternate location that is identified to the client connection. Rerouting is not required if using the IBM data server client as a Db2 Connect client. For details, see the topic about IBM data server client types.
Automatic client reroute with IBM Data Server feature redirects client applications from a failed server to an alternate server so the applications can continue their work with minimal interruption. Seamless automatic client reroute for Db2® for z/OS® Sysplex is on by default and is recommended when WLB is enabled. With this support, applications that access Db2 for z/OS Sysplex should use seamless automatic client reroute capabilities provided by the client, and are not required to go through a Db2 Connect server. For more information about this feature, see the topic about automatic client reroute (client-side) in the Db2 Information Center.
Outside of a Db2 Connect high-availability environment, the database being accessed is typically synchronized between the original Db2 server and the alternate Db2 server through one of various means, such as High availability disaster recovery (HADR) or IBM PowerHA® SystemMirror® for AIX®.
Rerouting capability for Sysplex can be configured between Db2 Connect and the host database server if Sysplex support is enabled. The rerouting capability for Sysplex is a Db2 Connect feature that allows it to try the connection against other members of the Sysplex group following the loss of communication with the original member. The alternate server does not need to be cataloged in the database directory to enable the reroute capability for Sysplex on Db2 Connect. By default, the reroute capability for Sysplex is enabled if Sysplex support is enabled.
In order for an IBM Data Server Client to have the ability to recover from a loss of communications to a Db2 Connect server using automatic client reroute, an alternate Db2 Connect server location must be specified before the loss of communication occurs. The UPDATE ALTERNATE SERVER FOR DATABASE command is used to define the alternate Db2 Connect server location for a particular IBM mainframe database. The alternate hostname and port number is given as part of the command. The location is stored in the system database directory file at the Db2 Connect server. In order to ensure the alternate Db2 Connect server location specified applies to that database for all clients, the alternate server location has to be specified at the Db2 Connect server side. The alternate server is ignored if it is set at the client instance.
For example, suppose a IBM mainframe
database is cataloged using a database alias of db1
at a Db2 Connect server
S1
(with a hostname of db2conn1
and a port number of
122
). The database administrator would like to specify an alternate Db2 Connect server
S2
at hostname db2conn2
with a port number of 123. Here is the
command the database administrator would run at the Db2 Connect server
S1
:
db2 update alternate server for database db1 using hostname db2conn2 port 123
After you have specified the alternate Db2 Connect server location for
database alias db1
at Db2 Connect
Server
S1
, the alternate server location information is returned to the IBM Data Server Client as part of the connection process. If communication
between the IBM Data Server Client and the Db2 Connect
Server
S1
is lost for any reason (typically a communication error, such as SQL code -30081
or SQL code -1224), the IBM Data Server Client will attempt to
reconnect to db1
through either the original Db2 Connect
Server
(S1
) or the alternate Db2 Connect
Server(S2
), alternating the attempts between the two servers. The time interval between
attempts starts off rapidly, then gradually lengthens with each attempt.
Once a connection is successful, the SQL code -30108 is returned to indicate that a database connection has been reestablished following the communication failure. The hostname or IP address and service name or port number are returned. The IBM Data Server Client only returns the error for the original communications failure to the application if the reestablishment of the client communications is not possible to either the original or alternative server.
- When using a Db2 Connect Server for providing access to an IBM mainframe database on behalf of both remote and local clients, confusion can arise regarding alternate server connectivity information in a system database directory entry. To minimize this confusion, consider cataloging two entries in the system database directory to represent the same IBM mainframe database. Catalog one entry for remote clients and catalog another for local clients.
- Any SYSPLEX information that is returned from a target Db2 for z/OS server is kept only in cache at the Db2 Connect Server. Only one alternate server is written to disk. When multiple alternates or multiple active servers exist, the information is only maintained in memory and is lost when the process terminates.