When to Take Checkpoints
Unlike a unit of recovery record, which is specified for transactions and driven by SQL statements, a checkpoint is a system-wide event. It can be scheduled by a system parameter, or triggered by a coordinator like IMS/DC, CICS, DB2's LOGLOAD, or by stopping DB2, etc. Checkpoints are also taken:
- Periodically during normal operations, with a
predefined interval. (This is what we just said; however, we shouldn't set this period too small as checkpoints themselves, as they write to the logs, have an overhead.)
- Active log switch
- End of restart DB2
- Normal termination of DB2
What to Archive?
You can use the new BACKUP SYSTEM utility to back up an entire DB2 subsystem or an entire DB2 data sharing group.
The BACKUP SYSTEM utility provides two options that you can specify:
- Full copy (full system backup) -- contains both logs and databases. One can recover the system to the point-in-time (PIT) at which the copy was taken. After restoring the backups, you can use a normal DB2 restart to bring the system back to the consistent state. The DB2 restart processing will take care of any outstanding units of work, by either completing their commit processing, or rolling back the changes they made so far (in case they did not reach a commit point).
- Data only -- copies only the DB, without the log. For this, you need to use the RESTORE SYSTEM utility to recover the system to an arbitrary point in time