-RECOVER INDOUBT command (Db2)

The Db2 command RECOVER INDOUBT recovers threads that are left in an indoubt state because Db2 or a transaction manager could not automatically resolve the indoubt status with the commit coordinator.

This command should only be used when automatic resolution will not work. The commit coordinator must determine the commit or abort decision.

Abbreviation: -REC IND

Environment

This command can be issued from a z/OS® console, a DSN session, a DB2I panel (DB2 COMMANDS), an IMS or CICS® terminal, or a program using the instrumentation facility interface (IFI).

Data sharing scope: Member

Authorization

To execute this command, you must use a privilege set of the process that includes one of the following privileges or authorities:
  • RECOVER privilege
  • System DBADM authority
  • SYSOPR authority
  • SYSCTRL authority
  • SYSADM authority

Db2 commands that are issued from a logged-on z/OS console or TSO SDSF can be checked by Db2 authorization using primary and secondary authorization IDs. Start of changeA logged-on z/OS user ID must be defined in RACF or a similar security server.End of change

Syntax

Read syntax diagramSkip visual syntax diagramRECOVER INDOUBT( connection-name)ACTION(COMMITABORT)ID(,correlation-id*)NID(,network-id)LUWID(,luwidtoken)

Option descriptions

( connection-name )
Specifies a one- to eight-character connection name. Allied threads (including those that are distributed) that belong to the connection name are recovered. This parameter is ignored if LUWID is specified.

The default is the connection name from which you enter the command. If you enter this command from a z/OS console, and you are recovering an allied thread using the ID or NID parameter, you must supply a connection name; no default connection name is available.

ACTION
Specifies whether to commit or abort the indoubt thread. If there are any downstream participants for which the local thread is the coordinator, the commit or abort decision is propagated to these participants.
Abbreviation: ACT
(COMMIT)
Commits the thread.
(ABORT)
Aborts the thread.
ID( correlation-id , …)
Specifies whether to recover a specific allied thread or all allied threads (including those that are distributed) that are associated with the connection name.
correlation-id
Is the correlation ID (1 to 12 characters) of a specific thread that is to be recovered. If you use more than one correlation ID, separate the IDs with commas.

Do not use a correlation ID that is associated with more than one network ID. Instead, use the NID option.

(*)
Recovers all indoubt threads that are associated with the connection name. Even threads that have the same correlation ID are resolved.
NID( network-id , …)
Specifies the network IDs of threads to recover.

network-id is a network ID that is associated with an individual thread. A single connection might have multiple network IDs associated with it. network-id is one of the following types of IDs:

  • For IMS and CICS connections, network-id is specified as net-node.number:
    net-node
    The network node name of the system that originated the unit of work. net-node is one to eight bytes in length.
    number
    A unique number within the system of origin. number is 1 to 16 bytes in length.
  • For RRSAF connections, network-id is the z/OS RRS unit of recovery ID (URID) that is used to uniquely identify a unit of work. A z/OS RRS URID is a 32-byte number.

The network ID appears in the recovery log of the commit coordinator as a 16-byte unique identification of a unit of work.

  • For IMS and CICS connections, the network ID is an 8-byte node name immediately followed by an 8-byte number.
  • For RRSAF connections, the network ID is a 16-byte number.
LUWID
Recovers the indoubt thread that has the specified LUWID.
luwid
Consists of an LU network name, an LUW instance number, and a commit sequence number.

The LU network name consists of a one- to eight-character network ID, a period, and a one- to eight-character network LU name. The LUW instance number consists of a period followed by 12 hexadecimal characters. The last element of the LUWID is the commit sequence number of 4 hexadecimal characters, preceded by a period.

token
A token is an alternate way to express an LUWID. Db2 assigns a token to each thread that it creates. It is a one- to six-digit decimal number that appears after the equal sign in all Db2 messages that display a LUWID.

If you enter one- to six-decimal digits, Db2 assumes that you are supplying a token. The token that Db2 assigns to a specific LUWID is unique for that Db2 subsystem, but not necessarily unique across all subsystems.

Usage note

When to use a network ID: A network-id is not normally needed, because a correlation-id can identify indoubt threads. However, if the correlation-id is not unique, network-id must be used. You do not need a network-id if you specify a LUWID.

If you specify a thread in the command that is part of a global transaction, the command is executed against all threads that are in the global transaction.

Examples

Example 1: Recover indoubt allied threads. Schedule a commit for all threads that are associated with the connection name from which the command is entered.
-RECOVER INDOUBT ACTION(COMMIT) ID(*)
Example 2: Recover an indoubt thread from a remote requester. Schedule a commit for the indoubt thread whose token is 1332.
-RECOVER INDOUBT ACTION(COMMIT) LUWID(1332)
Example 3: Recover indoubt threads from remote requesters. Schedule an abort for two indoubt threads. The first thread has an LUWID of DB2NET.LUNSITE0.A11A7D7B2057.0002. (The 0002 in the last segment of the LUWID represents the commit sequence number.) The second thread has a token of 442.
-RECOVER INDOUBT ACTION(ABORT)
         LUWID (DB2NET.LUNSITE0.A11A7D7B2057.0002, 442)