INGDB2

Purpose

The INGDB2 utility lets you:

  • Start or stop a table space
  • Terminate active threads
  • Inform TSO users that their thread is about to be terminated
  • Check for indoubt threads

Syntax

Read syntax diagramSkip visual syntax diagramINGDB2 TABLETERMCHECK_INDOUBTINFORM_TSOsubsystemparmTARGET=system_namedomain_IDsaplex_name

Parameters

TABLE
The TABLE parameter requests to start or stop a table space.

For DB2® table space stop, certain active threads that use the specified table space are terminated. These include REMOVE, DB2CALL, BATCH and TSO. TSO users are issued with a message informing them that their thread is about to be terminated before actual thread termination.

TERM
The TERM parameter requests the termination of all active threads for a DB2 subsystem. These include REMOTE, DB2CALL, BATCH, TSO and all remaining threads.

All threads are discovered using the DIS THD() command and canceled by token using CAN THD(tokenid). UTILITY threads are treated differently: after having been discovered using DIS UTIL() and checked not to be COPY, REORG, REPAIR or LOAD, they are terminated using the TERM UTIL() command. UTILITY threads are ignored during the cancel-threads-by-token process.

TSO users that are using threads that cannot be stopped are canceled.

CHECK_INDOUBT
This parameter requests a check for indoubt threads.
INFORM_TSO
With this parameter, TSO users with an active stoppable thread are informed that their thread is about to be terminated.
subsystem
Specifies the subsystem name of the DB2 subsystem.
parm
Specifies a positional parameter string.
When INGDB2 is called with TABLE as the first parameter, one or three values are expected at this position in the parameter sequence, as follows:
parm1
START or STOP to start or stop a table space.
parm2
A database name. This is not required if parm1 is START.
parm3
A table space name. This is not required if parm1 is START.
When all three parameters are passed to INGDB2, the START or STOP request applies to the specified table space.

If only START is passed to INGDB2, a start command is issued for all table spaces that are currently in the status LPL or GRECP. Table spaces of database DSNDB01 are started before those of database DSNDB06. After this, the table spaces of all other databases are started.

When requesting a STOP for a specified tablespace, the following processing cycles are done:

  1. The command STO DB(dbname) SPACENAM(tsname) is issued.

    If the specified table space is then still used by any DDF threads or BATCH jobs, these processes are canceled.

    TSO users of threads still using the table space are notified that the table space is to be stopped and they are requested to stop using it.

  2. If the table space is still used by TSO users, these users are canceled. After one minute, a message is send to the cancelled users to inform them at logon, that they were canceled due to the stop of a tablespace.
  3. If the table space is still used by any processes, a message is issued listing the name and type of all these processes.

The delay time between the processing cycles is determined by the STOP Tablespace Delay option in the DB2 CONTROL policy item of the DB2 master. The default value is 2 minutes.

TARGET
For information on the target parameter, see The TARGET Parameter in IBM Z System Automation Operator's Commands.

Version

When you specify INGDB2 TABLE,&SUBSAPPL,START [dbname tsname] as a command in the automation policy that is to be issued in response to a received message, code definitions for message ID DATABASE are used to decide whether any databases or table spaces are excluded from recovery.

To exclude databases or table spaces from recovery, specify a code definition as follows with IGNORE or EXCLUDE as the Value Returned.

Code1 Code2 Code3 Value Returned
database tablespace   IGNORE|EXCLUDE

Restrictions and Limitations

The INGDB2 utility can only be used when:

  • SA z/OS® is initialized
  • The DB2 subsystem is defined to SA z/OS as application of category DB2 and subcategory MSTR
  • The status of the DB2 subsystem is UP, but for TERM and INFORM_TSO the status can be AUTOTERM to allow for SHUTNORM passes.

For non-utility threads, only those with a non-zero token can be canceled with INGDB2 TERM.

Security considerations

The INGDB2 utility internally uses DB2 commands. For information about the appropriate security setup, see the Security considerations to control DB2 subsystems topic in IBM Z System Automation Planning and Installation.

Return Codes

0
Function completed successfully
1
Indoubt threads were found when being called with the CHECK_INDOUBT parameter
Note: When your INGDB2 CHECK_INDOUBT command is part of your DB2 shutdown commands in the policy and you have return code checking enabled (specified '*' in the AutoFn field), System Automation does not issue any other shutdown commands. The Automation Status of the DB2 is set to PROBLEM. Manual intervention is required.
4
Incorrect parameters were used in the call
5
Timeout or other error occurred (for example, the DB2 subsystem is not UP).
6
SA z/OS initialization incomplete, unable to process command request

Examples

To terminate threads for a DB2 subsystem called DB2P, enter the following command:
INGDB2 TERM DB2P
To start a table space where the DB2 subsystem is DB2P, the database name is DB2PDBN and the table space name is DB2PTSN, enter the following command:
INGDB2 TABLE DB2P START DB2PDBN DB2PTSN