Backups are how you survive a dropped table, a bad volume, or a dead data center. DB2 for z/OS gives you object-level image copies (the COPY utility), log-based redo and undo, and subsystem-level BACKUP SYSTEM / FlashCopy. Disaster recovery is the same pieces plus a remote site, a log truncation point, and a rehearsal. This page ties COPY, full and incremental copies, backout, and DR together.
| Term | When you see it |
|---|---|
| Redo | LOGAPPLY, restart forward recovery — replay logged changes onto a restore base |
| Undo / backout | Restart backward recovery, PIT LOGUNDO, RECOVER BACKOUT YES — reverse changes |
| Restore | Replace pages from an image copy or volume backup before redo |
The log is necessary but not sufficient for media recovery. If a VSAM data set is gone, there is nothing to apply redo to until you restore a copy. If you only need to reverse recent committed work on a healthy object, backout (RECOVER BACKOUT YES to a PIT) can skip the restore. Restart after a crash undoes inflight URs and redoes committed pages that never reached disk—no COPY involved.
Beginners hear “undo” and think ROLLBACK. Application ROLLBACK is undo of the current UR. Recovery undo is the same logging idea at utility or restart scale.
| Kind | Contents |
|---|---|
| Full image copy (FIC) | Every page of the object or partition |
| Incremental image copy (IIC) | Pages changed since a prior copy |
| FlashCopy image copy | Dataset-level FlashCopy; can include consistency options |
| System-level backup | BACKUP SYSTEM volume copy of copy pools |
Full image copies are the simple restore base. Take them on a cadence that matches how long you can afford LOGAPPLY to run. Incremental image copies shrink the backup window when few pages change; RECOVER must merge full + incrementals. MERGECOPY (or COPYTOCOPY) can turn a chain into a new full so recovery stays fast.
COPY can write local copies and recovery-site copies (RECOVERYDDN) in one run so the DR vault gets a tape without a second read of the table space. Dual independent output is as important as dual logging.
SHRLEVEL REFERENCE allows readers; writers wait. The copy is consistent as of the copy. SHRLEVEL CHANGE allows updates; the copy is “fuzzy.” RECOVER always applies log from the copy START_RBA, so current recovery is still consistent. For PIT, recover to a log point, not blindly TOCOPY of a CHANGE copy, if you need transactional consistency without extra thought.
COPY is the workhorse. It registers rows in SYSCOPY (ICTYPE F or I). Typical control:
123456789101112COPY TABLESPACE HRDB.EMPTS COPYDDN(LOCALDD) RECOVERYDDN(REMOTDD) FULL YES SHRLEVEL CHANGE PARALLEL CHECKPAGE; COPY TABLESPACE HRDB.EMPTS COPYDDN(INCRDD) FULL NO SHRLEVEL CHANGE;
Indexes are COPY YES (you COPY them) or COPY NO (you REBUILD after table recovery). Copying the table and not planning index rebuild/copy is an incomplete backup design.
After COPY, QUIESCE is optional but valuable: a SYSCOPY consistency point for PIT of a table space set. COPY itself does not replace QUIESCE for RI sets.
Object COPY does not snapshot the catalog, BSDS, and logs as one atomic system. BACKUP SYSTEM invokes DFSMShsm to FlashCopy the SMS copy pools you defined (typically a database copy pool and a log copy pool) for a subsystem or data sharing group. History is stored in the BSDS. Restrictions: SMS-managed data sets; no failed abnormally quiesced members in the group; SYSCTRL/SYSADM.
RESTORE SYSTEM restores the latest system-level backup before a log truncation point you set with DSNJU003, then applies log. You cannot pick an arbitrary old version by name the way you pick an image copy—plan version retention in HSM.
A related pattern: -SET LOG SUSPEND (quiesce 32 KB writes and extensions, freeze logging), FlashCopy all Db2 volumes including ICF catalogs, active logs, and BSDS, then SET LOG RESUME. For data sharing, SUSPEND each member. Recovery is restore volumes, start members, recover GRECP/LPL as needed. This is classic DASD-level DR.
A remote site needs:
Object-level RECOVER at DR works only if every needed SYSCOPY dataset and archive is there. System-level backup is usually faster for “the whole LPAR is gone.” Mix them: daily BACKUP SYSTEM plus more frequent COPY of critical table spaces.
Test restores. An untested RECOVERYDDN tape is not a backup. Clock-skew, 10-byte RBA format, and encryption keys kill DR weekends.
An image copy is a photo of the castle. A full photo shows every brick. An incremental photo shows only the bricks you moved since the last photo. Redo is following the diary (the log) to add the bricks you placed after the photo. Undo is taking bricks off because that part was never glued (not committed) or because you decided to go back to Friday. Disaster recovery is keeping a second photo album and diary at grandma’s house in case your house floods. COPY takes the photos. BACKUP SYSTEM photocopies the whole room.
1. A full image copy contains:
2. COPY SHRLEVEL CHANGE means:
3. Redo versus undo (backout):
4. BACKUP SYSTEM copies:
5. Incremental image copies require: