Managing history file on the HADR standby database

You can manually refresh the recovery history file on the HADR standby database to keep it consistent with the primary database by restoring the history file backup.

About this task

Changes to the recovery history file on the HADR primary database are not automatically replicated to the HADR standby database. It is recommended that you keep the history file on the standby database reasonably up to date by manually refreshing it through the RESTORE DATABASE HISTORY FILE command.

Procedure

  1. Identify a recent backup of the primary database, or issue the following command to take a new backup of just the history file on the primary database:
    db2 backup db <dbname> no tablespace online exclude logs
  2. Make this backup image accessible to the standby host, either placing it in a shared file system, or transfer the image from primary to standby host.
  3. On standby host, restore the history file, by using the <TIMESTAMP> of the backup image from step 1. This restore operation can be done online, without deactivating the standby database.
    db2 restore db <dbname> history file online taken at <TIMESTAMP>