Chapter 18 Quiz: Backup, Recovery, and Logging
Test your understanding of DB2 backup, recovery, and logging concepts. Each question has one best answer unless otherwise noted. Answers are provided at the end.
Question 1
What does the Write-Ahead Logging (WAL) protocol guarantee?
A) Data pages are always written to disk before log records B) Log records are written to stable storage before the corresponding data page changes are written to disk C) Both log records and data pages are written simultaneously D) Log records are written after the transaction commits
Question 2
On z/OS, what is the purpose of the Bootstrap Data Set (BSDS)?
A) It stores the database catalog tables B) It contains the initial DB2 installation configuration C) It is the master directory of the log, containing inventory of active and archive log data sets D) It stores backup copies of critical system tables
Question 3
Which of the following is NOT possible with circular logging on DB2 LUW?
A) Crash recovery B) Full offline backup C) Point-in-time recovery D) Normal transaction processing
Question 4
During crash recovery, the redo phase:
A) Only reapplies changes from committed transactions B) Reapplies all logged changes (both committed and uncommitted) from the last checkpoint forward C) Reverses changes from uncommitted transactions D) Rebuilds all indexes
Question 5
On z/OS, what is the difference between SHRLEVEL REFERENCE and SHRLEVEL CHANGE when running the COPY utility?
A) SHRLEVEL REFERENCE is faster than SHRLEVEL CHANGE B) SHRLEVEL REFERENCE allows concurrent updates; SHRLEVEL CHANGE does not C) SHRLEVEL REFERENCE takes an exclusive lock preventing concurrent updates; SHRLEVEL CHANGE allows concurrent updates D) There is no functional difference; they are aliases
Question 6
What is the correct order of operations for point-in-time recovery on DB2 LUW?
A) ROLLFORWARD, then RESTORE B) RESTORE, then ROLLFORWARD to the target time with AND COMPLETE C) BACKUP, then RESTORE, then ROLLFORWARD D) RESTORE, then RECOVER
Question 7
On z/OS, what RBA-based recovery option restores a tablespace to a specific log point?
A) TOCOPY B) TORBA (or TOLOGPOINT) C) TOTIME D) TOLSN
Question 8
What is the primary risk of setting LOGSECOND to -1 on DB2 LUW?
A) Secondary log files are never allocated B) DB2 allocates unlimited secondary log files, potentially filling the filesystem C) Crash recovery takes longer D) Archive logging is disabled
Question 9
An RPO of zero means:
A) The database never goes down B) Recovery takes zero time C) No committed transaction data can be lost D) Backups are taken continuously
Question 10
Which DB2 LUW HADR synchronization mode provides RPO = 0?
A) ASYNC B) SUPERASYNC C) NEARSYNC D) SYNC
Question 11
On z/OS, dual logging means:
A) Two copies of the active log are written simultaneously to separate devices B) Log records are written twice — once before and once after the data page change C) Two different databases share the same log D) Active logs and archive logs are the same data
Question 12
After performing a tablespace-level point-in-time recovery, what problem might arise with related tablespaces?
A) The related tablespaces are automatically dropped B) Referential integrity may be violated because related tablespaces are at a different point in time C) All indexes in the database are invalidated D) The database must be restarted before the tablespace can be used
Question 13
What is the LOGLOAD parameter on z/OS?
A) The maximum number of log data sets B) The number of log records between checkpoints C) The maximum log record size D) The number of concurrent transactions allowed
Question 14
On DB2 LUW, which command checks the current rollforward status?
A) db2 get db cfg for DBNAME
B) db2 rollforward database DBNAME query status
C) db2 list history backup all for DBNAME
D) db2 monitor log for DBNAME
Question 15
What is the 3-2-1 rule for backups?
A) 3 backups per day, 2 per week, 1 per month B) 3 copies of data, on 2 different media types, with 1 copy off-site C) 3 full backups, 2 incremental, 1 delta D) 3 seconds RPO, 2 minutes RTO, 1 hour backup window
Question 16
A DB2 LUW database has LOGFILSIZ=25600, LOGPRIMARY=30, LOGSECOND=20. What is the total active log capacity?
A) 2.5 GB B) 3 GB C) 5 GB D) 7.5 GB
Question 17
On z/OS, which utility prints the contents of the BSDS (log map)?
A) DSNJU003 B) DSNJU004 C) DSN1LOGP D) DSN1COPY
Question 18
What is a redirected restore on DB2 LUW?
A) A restore that sends data to a different server B) A restore where the database containers are mapped to different physical paths than the original C) A restore that redirects errors to a log file D) A restore from a remote backup location
Question 19
In an HADR NEARSYNC configuration, when does the primary COMMIT return to the application?
A) After the log record is written to the primary disk only B) After the log record is received in memory at the standby C) After the log record is written to disk at the standby D) After both primary and standby have written the log record to disk
Question 20
What is the most common cause of "log full" conditions on DB2 LUW?
A) Too many concurrent users B) A long-running transaction preventing log files from being freed C) Archive logging being enabled D) Insufficient buffer pool memory
Question 21
On z/OS, what happens when DB2 needs to write to an active log data set that has not yet been offloaded (archived)?
A) DB2 overwrites the unarchived data B) DB2 suspends all processing until the offload completes C) DB2 automatically allocates a new log data set D) DB2 terminates abnormally
Question 22
Which of the following is TRUE about incremental image copies on z/OS?
A) They contain all pages in the tablespace B) They contain only pages changed since the last full or incremental copy C) They do not require a full image copy as a base D) They cannot be used with SHRLEVEL CHANGE
Question 23
What is a conditional restart on z/OS?
A) A restart that only occurs if certain conditions are met B) A restart that overrides normal crash recovery behavior, such as truncating the log at a specific RBA C) A restart that depends on the time of day D) A restart initiated by the operating system rather than the DBA
Question 24
On DB2 LUW, what is the difference between an incremental backup and a delta backup?
A) They are the same thing B) An incremental backup captures changes since the last full backup; a delta backup captures changes since the last backup of any type C) A delta backup is larger than an incremental backup D) An incremental backup requires archive logging; a delta backup does not
Question 25
Why should disaster recovery plans be tested regularly?
A) Because the testing process generates useful backup images B) Because untested plans may contain errors, outdated procedures, or assumptions that no longer hold, and the team needs practice executing under pressure C) Because regulations require testing documentation D) Because DR hardware must be exercised to prevent deterioration
Answer Key
| Question | Answer | Explanation |
|---|---|---|
| 1 | B | WAL requires log records to reach stable storage before the corresponding data page changes. This ensures recoverability after any crash. |
| 2 | C | The BSDS contains the inventory of all active and archive log data sets, their RBA ranges, checkpoint information, and other log management metadata. |
| 3 | C | Circular logging reuses log files, so historical log records are lost. Point-in-time recovery requires archived logs. Crash recovery and offline backup are still possible. |
| 4 | B | The redo phase reapplies ALL logged changes from the last checkpoint forward — both committed and uncommitted. The undo phase then reverses uncommitted changes. |
| 5 | C | SHRLEVEL REFERENCE acquires an exclusive lock, preventing concurrent updates and producing a consistent copy. SHRLEVEL CHANGE allows concurrent updates, producing a "fuzzy" copy that DB2 can still use for recovery. |
| 6 | B | RESTORE rebuilds the database from a backup image. ROLLFORWARD then applies archived log records to bring the database to the target time. AND COMPLETE takes it out of rollforward-pending state. |
| 7 | B | TORBA (or TOLOGPOINT in newer versions) specifies the exact RBA/LRSN up to which log records should be applied during recovery. |
| 8 | B | LOGSECOND=-1 means DB2 allocates secondary log files without limit. A long-running transaction could cause log files to accumulate until the filesystem is full. |
| 9 | C | RPO = 0 means zero data loss — every committed transaction must be recoverable. This typically requires synchronous replication. |
| 10 | D | SYNC mode requires the log record to be written to disk at both the primary and standby before COMMIT returns, guaranteeing zero data loss. |
| 11 | A | Dual logging writes two copies of the active log simultaneously to separate physical devices, protecting against loss of a single log copy. |
| 12 | B | Tablespace-level PITR recovers one tablespace to a past time while others remain at the current time. Foreign key relationships between the recovered and non-recovered tablespaces may be violated. |
| 13 | B | LOGLOAD controls the number of log records written between system checkpoints. A smaller value means more frequent checkpoints and faster crash recovery. |
| 14 | B | The rollforward database DBNAME query status command shows the current rollforward position, next log file needed, and timestamp of the last applied log record. |
| 15 | B | The 3-2-1 rule: 3 copies of data, stored on 2 different types of media, with at least 1 copy stored off-site. |
| 16 | C | Total = (30 + 20) × 25,600 × 4 KB = 50 × 100 MB = 5 GB. |
| 17 | B | DSNJU004 prints the log map (BSDS contents). DSNJU003 is used to change the log inventory. |
| 18 | B | A redirected restore allows you to map database containers to different physical paths than where they originally resided. Essential for cloning databases or recovering to different storage. |
| 19 | B | NEARSYNC waits for the standby to acknowledge receipt of the log record in memory (not disk). This provides near-zero RPO with less latency impact than full SYNC. |
| 20 | B | A long-running transaction prevents DB2 from freeing the log files it spans. As new log files are allocated and old ones cannot be freed, the active log space fills up. |
| 21 | B | DB2 cannot overwrite an unarchived active log. It suspends all logging (and therefore all update processing) until the offload completes. This is a critical operational event. |
| 22 | B | Incremental image copies contain only pages that have changed since the last full or incremental copy, making them smaller and faster than full copies. |
| 23 | B | A conditional restart uses DSNJU003 to set parameters that override normal restart, such as truncating the log at a specific RBA. Used in emergency situations when normal restart fails. |
| 24 | B | Incremental captures changes since the last full backup (larger, fewer dependencies). Delta captures changes since the last backup of any type (smaller, more dependencies for restore). |
| 25 | B | Testing validates that the plan works, identifies gaps, and ensures the team can execute under pressure. A plan that has never been tested may fail when needed most. |