Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

SET-SESSION-DIAGNOSIS

This statement switches the deadlock analysis on and off.

Scope of validity

DBH administration

Function

The SET-SESSION-DIAGNOSIS statement controls the additional information output (deadlock analysis) when a deadlock occurs. Detailed information on the subject of deadlocks is provided in the “ Core manual”.

SET-SESSION-DIAGNOSIS

DIAGNOSIS = *ON(...) / *OFF(...)


*ON(...)



|

SELECT = *DEADLOCK-ANALYSIS


*OFF(...)



|

SELECT = *DEADLOCK-ANALYSIS

Operands

DIAGNOSIS =

When a deadlock occurs, defines whether further information on the deadlock should be output to SYSLST in addition to message SES3201.

DIAGNOSIS = *ON(SELECT=*DEADLOCK-ANALYSIS)
A deadlock analysis is output.

DIAGNOSIS = *OFF(SELECT=*DEADLOCK-ANALYSIS)
No further information is output.


Example

SYSLST output after SET-SESSION-DIAGNOSIS DIAGNOSIS=*ON(SELECT= *DEADLOCK-ANALYSIS) and after a deadlock has occurred:

******************** DEADLOCK-BEGIN ********************
USER:    D016ZE09TSN=8NLGDSQL
OBJECT:  00020002000800000000000700050401 ROW
USER:    D016ZE09TSN=8NLFDSQL
OBJECT:  00020002000B00000000000600050401 ROW
******************** DEADLOCK-END **********************
<date> <time> SES3201 DEADLOCK RESOLUTION
SESAM USER ID: D016ZE09TSN=8NLGDSQL 
%// 


Explanation of the outputs

The lines between DEADLOCK-BEGIN and DEADLOCK-END describe the cycle of the waiting users, starting from the initiating transaction.
Here one USER and one OBJECT line are written alternately. The order of the lines defines the wait relationships. A user waits for the next user; the initiating object stands between them. The last user output waits for the first user.
In the example the user task with TSN 8NLG waits for the user tasks with TSN 8NLF and vice versa.

Message SES3201 is then issued. In the example the user task was reset with TSN 8NLG.

USER output line
Contains the user’s ID.
In the case of UTM users the session counter appears.

OBJECT output line The output for the object contains:

  • internal information for object identification (depending on the object), e.g.:

    Distance 0: identification number of the associated database.
    This number corresponds to the order in which the databases are output in the case of SHOW-SQL-DB-CATALOG-ENTRIES, see "SHOW-SQL-DB-CATALOG-ENTRIES".

    Distance 2: identification number of the associated space (not for DBC). This corresponds to the content of the SPACE_ID column in the SYS_SPACES table in SYS_INFO_SCHEMA (not for object type DBC), see “ SQL Reference Manual Part 1: SQL Statements”.

    Distance 4: identification number of the table (in the case of TABLE and ROW). This corresponds to the content of the TABLE_ID column in the SYS_TABLES table in SYS_INFO_SCHEMA.

    These identification numbers are also contained in the SESCOSP reports (see section “Catalog-space table assignment table”). This table can also be used to ascertain the associated names if an access took place during logging.

    Please contact Customer Support for a detailed analysis.

  • the object type

    TABLE

    Locks a table

    ROW

    Locks a record in a table

    INDEX

    Locks an entire index

    SI-VAL

    Locks a value in the index

    DBC

    Removes an entry from the SQL database (catalog lock)

    SPACE

    Locks the user space

    PLAN

    Planned lock

    META

    Locks a metadata area

Administration command in ISP format and at the CALL DML interface

Not available.