Canceling threads/connections


Threads can be canceled by using the Thread/Connection List panel or by issuing the CANCEL command. Select the Cancel threads/connections option from the Operational Assist Menu to display the Thread/Connection List panel.

DDTG DBI1 Thread/Connection List Row 1 of 1
Command ===> ________________________________________________ Scroll ===> PAGE

  Commands: FILTER
ZPARMS
DETAIL
Select the desired entry to be canceled and press Enter. CANCEL ALL
C =Cancel CS =Cancel Synchronously

Act Subsys Connection Correlation Auth Id Plan Asid Status
.. DBBM DB2CALL BBSYSM MAINT N/A 0039 T
******************************* Bottom of data ***********************************

Use the Thread/Connection List panel to perform the actions that are listed in the following table:

Action

Description

FILTER

Filters the list of connections or threads by specific criteria

ZPARMS

Lists the OPERTUNE elements

DETAIL

Toggles between showing and hiding the Luwid, Requests, and Token fields in the information displayed about the threads and connections.

CANCEL ALL

Cancels all threads meeting the filter criteria. Control is returned to you without waiting for the cancel to complete.

C

Cancels the selected thread or connection. Control is returned to you without waiting for the cancel to complete.

CS

Cancels the selected thread or connection. Control is not returned to you until the cancel completes.

CANCEL ALL
SYNCH

Cancels all threads meeting the filter criteria. Control is not returned to you until the cancel completes.

Note

This command is not listed on the panel.

Considerations when canceling threads or connections

Consider the following information before canceling threads or connections:

  • You can use OPERTUNE to cancel threads, but sometimes a cancel is not possible; for example, when a thread is hung in Db2 because of logic errors. When you cancel a utility thread, you are responsible for restarting the thread and recovering the table space. OPERTUNE cannot cancel an IFI thread (monitor thread), because IFI has its own recovery routines and recovers from the cancel.
  • OPERTUNE cannot cancel threads that have their own ESTAE recovery logic. If you try to cancel a thread and it appears that the attempt has failed, verify whether an accounting record for the thread termination was created, followed by a recovery of the thread.
  • If all of the connection threads for the CICS attachment facility are canceled, you need to start the CICS attachment facility using the DSNC STRT command.
  • If a connection thread for IMS is canceled, you need to start the IMS connection using the /START command.
  • OPERTUNE must run at a dispatching priority higher than any Db2-allied address spaces. If it does not, cancel requests may not get the resources necessary for completion. You can cancel connections and threads in some allied address spaces. Cancel thread results for Db2 summarize the expected results when canceling a thread or a connection.

Environment

Thread status

Expected results

Batch

T (In Db2)

Cancel takes effect immediately

Batch

T* (Active in Db2)

Cancel takes effect immediately

Batch

QT (Queued Thread)

Cancel takes effect immediately

Batch

TR (Distributed)

Cancel takes effect on the next call to Db2

Batch

RA (Remote Access)

Cancel takes effect on the next call to Db2

Batch

N (Connection)

Cancel takes effect immediately

CICS

T (In Db2)

Cancel takes effect immediately

CICS

T* (Active in Db2)

Cancel takes effect immediately

CICS

TR (Distributed)

Cancel takes effect on the next call to Db2

CICS

RA (Remote Access)

Cancel takes effect on the next call to Db2

IMS

T (In Db2)

Cancel takes effect immediately

IMS

T* (Active in Db2)

Cancel takes effect immediately

IMS

TR (Distributed)

Cancel takes effect on the next call to Db2

IMS

RA (Remote Access)

Cancel takes effect on the next call to Db2

QMF

T (In Db2)

Cancel takes effect immediately

QMF

T* (Active in Db2)

Cancel takes effect immediately

QMF

QT (Queued Thread)

Cancel takes effect immediately

QMF

TR (Distributed)

Cancel takes effect on the next call to Db2

QMF

RA (Remote Access)

Cancel takes effect on the next call to Db2

QMF

N (Connection)

Cancel takes effect immediately

TSO

T (In Db2)

Cancel takes effect immediately

TSO

T* (Active in Db2)

Cancel takes effect immediately

TSO

QT (Queued Thread)

Cancel takes effect immediately

TSO

TR (Distributed)

Cancel takes effect on the next call to Db2

TSO

RA (Remote Access)

Cancel takes effect on the next call to Db2

TSO

N (Connection)

Cancel takes effect immediately


Note

The Status column displays the status of the thread as returned from a Db2 -DISPLAY THREAD command. An asterisk in the Thread Status column indicates that with any other status, the thread is active and eligible for immediate cancel and rollback if updates occur.

To cancel a thread or connection, perform the following steps:

  1. On the Thread/Connection List panel, type one of the following commands:
    • C in the Act field next to the connection or thread you want to cancel
    • CS in the Act field next to the connection or thread you want to cancel
    • CANCEL ALL on the Command line
      You will need to filter the threads. See Filtering threads.
    • CANCEL ALL SYNCH on the Command line
      You will need to filter the threads. See Filtering threads.
  2. Press Enter.
  3. Issue the command from the Command Confirmation panel by typing 1 in the selection field and pressing Enter. To cancel the command, type 2 in the selection field and press Enter.

Filtering threads

If the list of threads or connections on the Thread/Connections panel is too long, or you want to use the CANCEL ALL or CANCEL ALL SYNC command on a group of threads, you must filter the threads.

  1. Type FILTER on the Command line and press Enter.

    Use the Thread/Connection Filter Specifications Panel to filter the display of threads or connections in the following ways:


      • Connection name
      • Correlation ID
      • Authorization ID
      • Plan name
      • Address space ID
      • Thread status
    DDTG DBI1 Thread/Connection Filter Specifications
    Command ===> _________________________________________________________________

    Filter Information
    Connection name . . . . . . ________
    Correlation id . . . . . . .____________
    Authorization id . . . . . .________
    Plan name . . . . . . . . . ________
    Address space id . . . . . . ____
    Thread status . . . . . . . ___ (D,DI,N,PT,Q,QD,QT,RA,RD,RN,RQ,SP,SW,T,TN,TR
     followed by optional '*')
  2. Type the information (in uppercase or lowercase) that you want to use to filter the threads into the appropriate fields, and press Enter. You can use wildcards as follows:

    • ? can be substituted for any single character
    • * can be substituted for one or more characters at the end of a specification

You will be returned to the Thread/Connection List panel, and the threads or connections will be filtered according to your specifications.

Canceling threads or connections using the CANCEL command

The CANCEL command can be issued through the modify command as follows:

IN(DB2ssid@opertuneID) CANCEL

image2018-12-26_10-10-17.png

Value

Description

DB2ssid

Db2 subsystem ID or the name of the Db2 data sharing group to which the command applies.

opertuneID

OPERTUNE system profile name (if OPERTUNE is running as a started task) or the batch job name (if OPERTUNE is running as a batch job).

connection

The connection name of the thread being canceled.

correlationID

The correlation ID of the thread being canceled.

authID

The authorization ID of the thread being canceled.

plan

The plan name for the thread being canceled.

address

The address space of the thread being canceled.

luwID

The logical unit of work ID. The LUWID consists of the following components:

  • (Optional) Fully-qualified LU network name
  • (Required) LU instance number

Use the DISPLAY THREAD command to obtain the LUWID (see DISPLAY THREAD command).

tokenID

The token that uniquely identifies the thread to Db2.
Use the DISPLAY THREAD command to obtain the token ID (see DISPLAY THREAD command).

ALL

All threads matching the specifications are canceled.

SYNC

Control does not return to the user until the cancel completes.



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*