Point-in-time recovery with system-level backups
System-level backups are fast replication backups that are created by using the BACKUP SYSTEM utility.
The BACKUP SYSTEM utility invokes DFSMShsm services to take volume copies of the data in a sharing Db2 system. All Db2 data sets that are to be copied (and then recovered) must be managed by SMS.
The BACKUP SYSTEM utility requires z/OS later data structures called copy pools. Because these data structures are implemented in z/OS, Db2 cannot generate copy pools automatically. Before you invoke the BACKUP SYSTEM utility, copy pools must be allocated in z/OS.
The BACKUP SYSTEM utility invokes the DFSMShsm fast replication function to take volume level backups using FlashCopy®.
You can use the BACKUP SYSTEM utility to ease the task of managing data recovery. Choose either DATA ONLY or FULL, depending on your recovery needs. Choose FULL if you want to backup both your Db2 data and your Db2 logs.
Because the BACKUP SYSTEM utility does not quiesce transactions, the system-level backup is a fuzzy copy, which might not contain committed data and might contain uncommitted data. The RESTORE SYSTEM utility uses these backups to restore databases to a given point in time. The Db2 data is made consistent by Db2 restart processing and the RESTORE SYSTEM utility. Db2 restart processing determines which transactions were active at the given recovery point, and writes the compensation log records for any uncommitted work that needs to be backed out. The RESTORE SYSTEM utility restores the database copy pool, and then applies the log records to bring the Db2 data to consistency. During the LOGAPPLY phase of the RESTORE SYSTEM utility, log records are applied to redo the committed work that is missing from the system-level backup, and log records are applied to undo the uncommitted work that might have been contained in the system-level backup.
- Data-only system backups
- The BACKUP SYSTEM DATA ONLY utility control statement
creates system-level backups that contain only databases.
The RESTORE SYSTEM utility uses these backups to restore databases to a given point in time. In this type of recovery, you lose only a few seconds of data, or none, based on the given recovery point. However, recovery time varies and might be extended due to the processing of the Db2 logs during Db2 restart and during the LOGAPPLY phase of the RESTORE SYSTEM utility. The number of logs to process depends on the amount of activity on your Db2 system between the time of the system-level backup and the given recovery point.
- Full system backups
- The BACKUP SYSTEM FULL utility control statement
creates system-level backups that contain both logs and databases.
With these backups, you can recover your Db2 system
to the point in time of a backup by using normal Db2 restart
recovery, or to a given point in time by using the RESTORE SYSTEM
utility.
To recover your Db2 system to the point in time of a backup by using normal Db2 restart recovery, stop Db2, and then restore both the database and log copy pools outside of Db2 by using DFSMShsm FRRECOV COPYPOOL (cpname) GENERATION (gen). After you successfully restart Db2, your Db2 system has been recovered to a point of consistency based on the time of the backup.
The RESTORE SYSTEM utility uses full system backup copies as input, but the utility does not restore the volumes in the log copy pool. If your situation requires that the volumes in the log copy pool be restored, you must restore the log copy pool before restarting Db2. For example, you should restore the log copy pool when you are using a full system-level backup at your remote site for disaster recovery.
When you recover your Db2 system to the point in time of a full system backup, you could lose a few hours of data, because you are restoring your Db2 data and logs to the time of the backup. However, recovery time is brief, because Db2 restart processing and the RESTORE SYSTEM utility need to process a minimal number of logs.
If you choose not to restore the log copy pool prior to running the RESTORE SYSTEM utility, the recovery is equivalent to the recovery of a system with data-only backups. In this type of recovery, you lose only a few seconds of data, or none, based on the given recovery point. However, recovery time varies and might be extended due to the processing of the Db2 logs during Db2 restart and during the LOGAPPLY phase of the RESTORE SYSTEM utility. The number of logs to process depends on the amount of activity on your Db2 system between the time of the system-level backup and the given recovery point.
You can use the BACKUP SYSTEM utility to manage system-level backups on tape. Choose either DUMP or DUMPONLY to dump to tape.
Use the DUMP and DUMPONLY options for:
- Managing the available DASD space.
- Retaining the system-level backups for the long term.
- Providing a means of recovery after a media failure.
- Remote site recovery procedure.