IBM Support

Steps to reestablish HADR after a failure on Standby

Question & Answer


Question

How to reestablish HADR from scratch after a failure on Standby

Cause

Have a HADR pair with Primary online but a failure on the Standby makes it necessary to reestablish the HADR pair again

Answer

This note intends to serve as a quick guide to reestablish HADR, please follow the Information Center link below (Initializing high availability disaster recovery HADR) for full documentation.

1. ON THE PRIMARY MACHINE:

- Break HADR
db2 "STOP HADR ON DB <database>"

Please note that this step is not always needed. If there has been a failure on the Standby and the Standby is inactive, the expected situation is that the HADR would be on a "disconnected" state.
This command ensures that the Primary database is on Standard mode and that we do not have any HADR processes running.
Please review the "STOP HADR command" link below for reference and check its behaviour depending on the state of the server.

- Take a new backup image
db2 "backup database <database> ONLINE to <path>"

Please note that on the backup and restore commands detailed here and on step 2. we are putting the simplest command. Backup/ Restore can be done using TSM, path could be a NFS exported drive so that ftp is not needed on step 2. Split mirror is also a valid approach for backup.

2. ON THE STANDBY MACHINE:

- FTP the backup image (from the primary machine) to the STANDBY MACHINE
- db2 "drop database <database>"
- db2 "restore database <database> from <path>"

- Set up HADR cfg parameters on standby database

db2 update db cfg for <database> using HADR_LOCAL_HOST <local host>
db2 update db cfg for <database> using HADR_LOCAL_SVC <local port>
db2 update db cfg for <database> using HADR_REMOTE_HOST <remote host>
db2 update db cfg for <database> using HADR_REMOTE_SVC <remote port>
db2 update db cfg for <database> using HADR_REMOTE_INST <remote instance>

- Start up HADR on standby server
db2 start hadr on database <database> as standby

3. ON THE PRIMARY MACHINE:

- Start up HADR on the primary server
db2 start hadr on database <database> as primary

- Verify HADR is up and running
db2pd -db <database> -hadr

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

Document Information

Modified date:
09 September 2019

UID

swg21514783