IBM Support

Steps for adding a new Auxiliary Standby to an existing Db2 HADR Pair

How To


Summary

Multiple standby database setup when you already have an existing HADR Primary and Standby

Steps

1.  For each database, collect a Db2 backup from the primary server:
 db2 backup db <dbname> online to /tmp/backups
2.  For each database, restore the backups onto the new Aux Standby server
db2 restore db <dbname> from /tmp/backups taken at <timestamp of backup>

3.  Determine the host name, port number, and instance name that will be in the HADR setup.  
Example:
Role                         Host name    Port number   Instance name
Primary                      server1       60061             dbinst1
Principal standby    server2       60062             dbinst2
Auxiliary standby    server3       60063             dbinst3
Note that all servers must be on the same network.  You’ll want to define a port for each instance to use for HADR. They should be also reserved/updated in services file on Windows or the /etc/services file in Unix.
Sample /etc/services file:
server1   60061/tcp # Reserved for DB2 hadr failover
server2   60062/tcp # Reserved for DB2 hadr failover
server3   60063/tcp # Reserved for DB2 hadr failover
4.  Stop HADR for each database on the existing Primary and Standby servers.
db2 STOP HADR ON DATABASE <dbname>
5.  On each server,  update the HADR_TARGET_LIST setting for each database as follows:
server1:
db2 update db cfg for <dbname> using HADR_TARGET_LIST server2:60062|server3:60063 immediate
server2:
db2 update db cfg for <dbname> using HADR_TARGET_LIST server1:60061|server3:60063 immediate
server3:
db2 update db cfg for <dbname> using HADR_TARGET_LIST server1:60061|server2:60062 immediate
6.  On the new Aux Standby (server3) configure the following settings for each database  (these should already be set on the other two servers, since HADR is currently up and running there):

db2 update db cfg for <dbname> using HADR_SYNCMODE SUPERASYNC
db2 update db cfg for <dbname> using HADR_LOCAL_HOST server3
db2 update db cfg for <dbname> using HADR_LOCAL_SVC 60063
db2 update db cfg for <dbname> using HADR_REMOTE_HOST server1
db2 update db cfg for <dbname> using HADR_REMOTE_SVC 60061
db2 update db cfg for <dbname> using HADR_REMOTE_INST db2inst1

7. Start HADR on each server, for each database.

The correct order for starting HADR is to start HADR on the principal standby first,  then the Aux standby, and then start it on the primary

On Principal Standby  (server2):
db2 start hadr on database <DBNAME> as standby

On Aux Standby  (server3):
db2 start hadr on database <DBNAME> as standby

On Primary (server1):
db2 start hadr on database <DBNAME> as primary

Verify that the HADR pair is up and running:
   db2pd -db <DBNAME> -hadr

 

Additional Information


For additional reference:

Adding auxiliary standbys to a multiple standby database setup
https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.admin.ha.doc/doc/c0059996.html

Document Location

Worldwide

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"HADR","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
23 March 2020

UID

ibm16116002