RECOVER commands in DB2 for z/OS

Three operator commands share the verb RECOVER and none of them is the RECOVER utility. On DB2 for z/OS, -RECOVER BSDS restores dual bootstrap data sets, -RECOVER INDOUBT completes a stuck two-phase commit, and -RECOVER POSTPONED finishes backout that restart postponed. This page explains each command, every identification option, and the messages you should expect.

Db2 operator commands
Progress0 of 0 lessons

Operator RECOVER versus the RECOVER utility

The utility reads image copies and applies log to a table space or index. The operator commands repair control information (BSDS) or units of recovery (indoubt and postponed abort). You still use the utility when a page set is RECP after a failed backout. Keep the names straight on the bridge: “recover the tablespace” is DSNUTILB; “recover indoubt” is a hyphen command.

Operator RECOVER commands
CommandAbbreviationPurpose
-RECOVER BSDS-REC BSDSRebuild dual BSDS after one copy failed
-RECOVER INDOUBT-REC INDManually commit or abort a UR stuck indoubt
-RECOVER POSTPONED-REC POSTFinish backout for postponed-abort URs after restart

-RECOVER BSDS

Dual BSDS mode means two copies of the bootstrap data set, which records active and archive log inventory, checkpoint information, and related restart control data. If one copy hits a data set error, Db2 disables and deallocates that copy. You are then in single-BSDS mode until you repair it.

IBM’s documented steps:

  • Use access method services to rename or delete the failing BSDS and DEFINE a new cluster with the same name. Sample control statements are in job DSNTIJIN.
  • Issue -RECOVER BSDS. Db2 copies the remaining good BSDS into the new data set and returns to dual mode.

Authorization: BSDS privilege, SYSCTRL, or SYSADM. Member scope. No extra keywords—the command is just RECOVER BSDS. If both copies are gone, this command cannot help; you restore BSDS from a backup (often with DSNJU003 / DSNJU004 and the Administration Guide procedure) and then restart.

text
1
-RECOVER BSDS

-RECOVER INDOUBT

A thread is indoubt when Db2 (as a participant) finished the prepare phase of two-phase commit and then lost contact with the commit coordinator before learning COMMIT or ROLLBACK. Automatic resolution usually reconnects and finishes. -RECOVER INDOUBT is for when automatic resolution will not work. The coordinator—not guesswork—must determine COMMIT or ABORT. Abbreviation -REC IND.

Authorization: RECOVER privilege, System DBADM, SYSOPR, SYSCTRL, or SYSADM. Member scope. If this thread is coordinator for downstream participants, the same decision is propagated to them.

ACTION

  • ACTION(COMMIT) (abbreviation ACT) — commit the UR
  • ACTION(ABORT) — abort (roll back) the UR

How you name the thread

RECOVER INDOUBT identification options
OptionMeaning
connection-nameOne- to eight-character connection. Default is the connection you entered from; from a z/OS console you must supply it when using ID or NID. Ignored if LUWID is specified.
ID(correlation-id)1–12 character correlation ID of an allied thread (including distributed allied).
ID(*)All indoubt threads for that connection name, even if correlation IDs collide.
NID(network-id)IMS/CICS: net-node.number (3–25 characters). RRSAF: 32-character RRS URID. Use when correlation ID is not unique.
LUWID(luwid|token)Full LUWID (network.luname.12-hex.4-hex commit seq) or a 1–6 digit token assigned by this member.

For IMS and CICS, the network ID on the coordinator log is an 8-byte node name plus an 8-byte number. For RRSAF it is a 16-byte (32 hex character) RRS URID. You do not need NID if you specify LUWID. Do not use a correlation ID that belongs to more than one network ID—use NID instead. If the named thread is part of a global transaction, the command applies to all threads in that global transaction.

text
1
2
3
-RECOVER INDOUBT ACTION(COMMIT) ID(*) -RECOVER INDOUBT ACTION(COMMIT) LUWID(1332) -RECOVER INDOUBT ACTION(ABORT) LUWID(DB2NET.LUNSITE0.A11A7D7B2057.0002,442)

After a CANCEL THREAD of distributed work, DSNL450I may tell you the thread became indoubt. That is the same family of problem: wait for automatic resync, or RECOVER INDOUBT once the coordinator’s decision is known. RESET INDOUBT only clears the DISPLAY report; it does not resolve the UR.

-RECOVER POSTPONED

At restart, Db2 can postpone backout of some units of recovery (postponed abort) so the subsystem comes up faster while those objects remain in a restart-pending state. -RECOVER POSTPONED completes that backout when automatic resolution was not selected. Abbreviation -REC POST. Same RECOVER / System DBADM / SYSOPR / SYSCTRL / SYSADM authorization. Member scope.

  • Default (no CANCEL) — recovery (rollback) for all postponed-abort URs. DSNI024I reports backout complete for a page set or partition and removal from restart-pending. Long backout issues progress message DSNR047I. DSN9022I is success; DSN9023I is failure. DSNV434I means no postponed-abort threads were found (still a normal completion with DSN9022I). DSNV435I means resolution was scheduled.
  • CANCEL — stop processing postponed abort URs immediately. Objects can be left inconsistent. If backout fails they are marked REFP and RECP or RBDP/PSRBD. Fix REFP with the RECOVER utility to a prior point in time or LOAD REPLACE.
text
1
2
-RECOVER POSTPONED -RECOVER POSTPONED CANCEL

Output is informational messages only. Watch DSNI024I per page set so you know which objects left restart-pending. Do not confuse postponed abort (restart backout delayed) with indoubt (commit decision unknown). POSTPONED always rolls back unless you CANCEL the postponed work; INDOUBT requires an explicit COMMIT or ABORT.

A calm incident checklist

  • BSDS error messages: DISPLAY LOG / DISPLAY ARCHIVE, verify you still have one good BSDS, IDCAMS DEFINE the failed name, RECOVER BSDS, confirm dual mode
  • Indoubt after CICS/IMS/DDF outage: DISPLAY THREAD, contact the coordinator, RECOVER INDOUBT ACTION(…) with LUWID or ID, then RESET INDOUBT if your procedures require a clean display
  • Restart-pending after a long abort: DISPLAY THREAD / DISPLAY DATABASE for REFP/RECP, RECOVER POSTPONED, wait for DSNI024I, only then start applications on those objects

Explain It Like I'm Five

The BSDS is the library’s two identical card catalogs. If one catalog burns, you photocopy the surviving catalog onto a new set of drawers (RECOVER BSDS). Indoubt is a checkout where the librarian and the branch manager lost the phone call about whether the book is sold or returned—you must ask the manager, then stamp COMMIT or ABORT. Postponed abort is “we opened the library before putting those messy returns back on the shelf”—RECOVER POSTPONED is the crew that finally reshelves them.

Exercises

  1. List the IDCAMS and Db2 command steps to restore dual BSDS after COPY2 fails.
  2. DISPLAY THREAD shows an indoubt CICS thread with a duplicated correlation ID. Which identification option should you use instead of ID(correlation-id)?
  3. Write RECOVER INDOUBT to abort two threads: one LUWID with commit sequence 0002 and one token 442.
  4. After restart, objects remain restart-pending. Write the command that finishes postponed backout and name two messages that indicate progress versus “nothing to do.”
  5. Explain in one paragraph why RESET INDOUBT is not a substitute for RECOVER INDOUBT.

Quiz

Test Your Knowledge

1. What does -RECOVER BSDS do?

  • Runs the RECOVER utility on DSNDB01
  • Copies the remaining good bootstrap data set into a newly allocated BSDS and reestablishes dual BSDS mode
  • Restores archive logs from tape
  • Commits all indoubt threads

2. When should you use -RECOVER INDOUBT?

  • After every COMMIT
  • Only when automatic resolution with the commit coordinator will not work, and the coordinator has decided COMMIT or ABORT
  • Instead of RECOVER POSTPONED always
  • To rebuild indexes

3. What are postponed-abort units of recovery?

  • Threads waiting for DDF QUIESCE
  • URs whose backout was left incomplete at an earlier restart when postponed abort was in effect
  • Utilities in STOPP
  • Pages in the GBP

4. How do you identify an allied indoubt thread from the console?

  • Only by buffer pool name
  • Supply connection-name plus ID(correlation-id), ID(*), NID(network-id), or LUWID(luwid|token)
  • Only by AUTHID
  • By STOP DATABASE name

5. RECOVER POSTPONED CANCEL leaves objects how?

  • Always consistent
  • Inconsistent; if backout fails they can be REFP plus RECP or RBDP/PSRBD until RECOVER utility or LOAD REPLACE
  • Dropped
  • In UTRO only