Backup, Recovery, and Log Management
This domain tests how Db2 12 protects data with image copies, logs, and point-in-time recovery, including data sharing recovery.
Core rules
- Logs include active and archive logs, dual logging, and two BSDS copies. LOGLOAD and CHECKPOINT control checkpoint frequency; archive log truncation depends on copy and recovery needs.
- Image copies are full or incremental. COPY SHRLEVEL CHANGE works online; inline copies come from REORG or LOAD. Indexes can be rebuilt or recovered; consider COPY YES or NO for indexes.
- RECOVER can use TOLOGPOINT, TORBA, or TOCOPY. Point-in-time recovery uses the correct log range and can use conditional restart.
- BACKUP SYSTEM and RESTORE SYSTEM provide system-level backup but are not a substitute for log-based recovery.
- In data sharing, group buffer pool recovery and member restart affect retained locks and indoubt units of work.
Worked example
A table is accidentally updated at 10:15. The DBA finds a full image copy at 02:00 and archive logs through 10:20, then runs RECOVER TABLESPACE ... TOLOGPOINT to a log point just before 10:15 and rebuilds indexes. Reasoning: the copy plus logs rolls forward to the point in time; the log point must be after the copy and before the bad update.
Traps
- A LOG(NO) LOAD cannot be recovered with log apply; you need a new copy.
- A missing archive log makes point-in-time recovery impossible beyond that point.
- RECOVER does not automatically fix indexes unless you include them or rebuild.
- Conditional restart without correct BSDS and log inventory can lose data.