Backing up DB2 (HADR) standby servers
You can use IBM® Storage Protect Snapshot to create snapshot backups of a DB2® High-Availability Disaster Recovery (HADR) standby server.
Although DB2 (HADR) standby server cannot be directly backed up to a IBM Storage Protect server, snapshot backups and subsequent backups of the snapshot files are possible. To ensure application consistency of the DB2 (HADR) standby database, the database must be deactivated or stopped before the snapshot is created. Then, after the snapshot is created the database must be reactivated or started again. Sample scripts that show you how to shut down and restart the DB2 (HADR) standby server are in the instance directory. You can customize these sample scripts. The scripts are available when IBM Storage Protect Snapshot is configured for DB2 (HADR) standby server support. The sample scripts can be used as parameter values for the IBM Storage Protect Snapshot profile PRE_FLASH_CMD and POST_FLASH_CMD parameters in the DB2STANDBY section of the profile file.
- Log on to the DB2 (HADR) standby server and use the database instance owner user ID.
- Change to the instance directory. For example, <DB2 instance owner $HOME>/sqllib/acs/
- Enter the following command:
./fcmcli -f backup_db2standby
After a DB2 takeover, the DB2 (HADR) standby server becomes the DB2 (HADR) primary server. After this takeover, use the DB2 snapshot backup command for backup. Do not use the backup_db2standby command. IBM Storage Protect Snapshot supports sharing the profile for both types of backups. You need only to use a different command to start your database backup that is dependent on the current DB2 HADR database role.
Because IBM Storage Protect Snapshot software cannot directly communicate with the standby server, IBM Storage Protect Snapshot queries the DB2 instance that is running on the primary server by using DB2 remote connections. The software assumes that the file names for the production server database and the standby server database are identical. IBM Storage Protect Snapshot can back up in situations where the DB2 automatic storage managed table spaces are in use, which can cause table space container IDs on the HADR primary and standby server to be mismatched.
You cannot use DB2 commands to create a DB2 backup of the standby databases and offload directly to an IBM Storage Protect server. You can use IBM Storage Protect Snapshot to start a file-based IBM Storage Protect backup from the snapshot using the IBM Storage Protect backup-archive client.
You cannot use DB2 for a database restore from the file-based IBM Storage Protect backups. Use the IBM Storage Protect backup-archive client to restore the files that are backed up to the IBM Storage Protect server. Recover the database by using the DB2 recover command.