Not every failure is a crash. Sometimes yesterday’s bad UPDATE is still committed, a volume died, or you need the payroll table as of Friday 18:00. DB2 point-in-time (PIT) recovery uses the RECOVER utility,image copies, and the log (addressed by RBA or LRSN) to rebuild objects to an earlier consistent state. This page separates crash recovery, object recovery, PIT, system recovery, and disaster recovery, and shows how SYSCOPY history and MODIFY RECOVERY control what is even possible.
| Kind | Goal |
|---|---|
| Crash / restart recovery | Current consistent state after Db2 or power failure |
| Table space / index / page recovery | Repair media or logical damage for specific objects, usually to current |
| Point-in-time recovery | Objects as of an earlier RBA, LRSN, timestamp, or copy |
| System recovery | RESTORE SYSTEM / volume FlashCopy of the whole subsystem or group |
| Disaster recovery | Same ideas at a remote site after loss of the primary data center |
Crash recovery runs at START DB2: redo/undo to current. You do not pick a timestamp. Table space recovery to current restores a copy and applies log to now—typical after restoring a damaged VSAM data set. Index recovery is RECOVER INDEX (if COPY YES and copies exist) or REBUILD INDEX from the table. Page recovery (RECOVER … PAGE) fixes one page. PIT adds a TO* keyword so you stop earlier.
A log RBA is a location in one member’s log stream. An LRSN is a group-wide sequence number in data sharing (timestamp-derived).RBA recovery (TORBA) is correct for a standalone subsystem. LRSN recovery (TOLOGPOINT with an LRSN) is required once data sharing exists. Timestamp recovery means “find the log point that corresponds to this clock reading”—tools and some RECOVER forms help, but you are still recovering to a log point, not magically to wall-clock without logs.
IBM and practitioners recommend standardizing on TOLOGPOINT even when the value is an RBA, so you do not grab the wrong TORBA after the group was created.
RECOVER can restore from sequential image copies, FlashCopy image copies, a system-level backup, or the log alone (from CREATE/LOAD/REORG if no copy remains and SYSLGRNX still has the range).
| Keyword | Meaning |
|---|---|
| TOCOPY / TODN / TOLASTCOPY / TOLASTFULLCOPY | Stop at a named or last image copy |
| TORBA | Log RBA (non-data-sharing; use with care) |
| TOLOGPOINT | Log point (RBA or LRSN); preferred PIT keyword |
| Current (no TO*) | Restore copy + log apply to end of log |
12345678RECOVER TABLESPACE HRDB.EMPTS TOLOGPOINT X'000000001C2A3B4C5D6E' PARALLEL REUSE; RECOVER TABLESPACE HRDB.EMPTS TORBA X'000000001C2A3B4C5D6E' BACKOUT YES;
Important phases for PIT:
TOCOPY of a SHRLEVEL CHANGE copy without going through a log point can leave uncommitted data in the restored pages. Prefer TOLOGPOINT at the copy’s log point if you need consistency. IBM documents extra PIT restrictions (which objects may be recovered together, not to a point inside some utilities, and so on)—read those before a production PIT.
A point of consistency is a moment with no inflight URs on the objects you care about. The QUIESCE utility writes SYSCOPY rows (and can write a log-range bookmark) after draining activity. Recovering a referential set to the same quiesce RBA/LRSN keeps parent and child aligned.
Without a quiesce, PIT consistency still rolls back URs that were active at the target, but applications that committed “bad” data before that point stay bad—you chose the time, not the business meaning.
SYSIBM.SYSCOPY is the recovery catalog: COPY, QUIESCE, LOAD, REORG, RECOVER events. SYSIBM.SYSLGRNX records which log ranges an object used. The REPORT RECOVERY utility prints what RECOVER would use.
MODIFY RECOVERY deletes old SYSCOPY/SYSLGRNX rows to reclaim catalog space. It also inserts rows that document the deletion. After MODIFY, you cannot recover to the discarded copies or through discarded log ranges. Align MODIFY with image-copy and archive-log retention. Running MODIFY because “the table looked messy” is a classic way to make tomorrow’s RECOVER fail.
Recovering one table space to Friday and its child to Thursday breaks foreign keys even if both jobs return RC 0.
System recovery uses BACKUP SYSTEM / RESTORE SYSTEM (DFSMShsm copy pools, FlashCopy volumes of data and logs) or a SET LOG SUSPEND + volume dump procedure. You truncate the log to a chosen point (DSNJU003) and bring the whole subsystem back to that time.
Disaster recovery is the same toolkit after the primary site is gone: mirrored or shipped archives, remote image copies or system-level backups, dual BSDS copies, documented restart order for data sharing members. Object-level PIT at the home site does not replace a DR rehearsal. The next page covers image copies, COPY, redo, and undo in backup language.
Crash recovery is “the lights flickered; put the Lego table back the way it was when the lights went out.” Point-in-time recovery is “throw away today’s mess and rebuild the castle from the photo we took Friday, then replay the building instructions (the log) up to Friday night.” RBA/LRSN are page numbers in the instruction book. QUIESCE is making everyone put bricks down so the photo is not blurry. MODIFY RECOVERY is throwing old photos away—fine until you need one.
1. Crash (restart) recovery versus point-in-time recovery:
2. In a data sharing group, the usual PIT log target is:
3. Why is a QUIESCE a good recovery point?
4. MODIFY RECOVERY is dangerous when:
5. RECOVER PAGE recovers: