Db2 commands for troubleshooting

You can use commands to perform the tasks that are required to control and maintain your Db2 subsystem.

Start of change

DISPLAY DATABASE LRSN command for troubleshooting

The Db2 command DISPLAY DATABASE with the LRSN keyword displays the commit LRSN and the read LRSN for a particular page set or partition.

Begin program-specific programming interface information.

The read LRSN is the LRSN at which read interest is acquired on a page set or partition. The commit LRSN is the LRSN of the oldest write claim on a page set or partition. This information can be used to diagnose performance issues that are related to over-locking or inefficient space reuse.

LRSN
Specifies that the Db2 database manager displays the commit LRSN and the read LRSN for a particular page set or partition. The LRSN keyword cannot be used with keywords other than DATABASE, SPACENAM, or PART.
The LRSN values are displayed as local timestamps, in this format:
mm/dd/yyyy hh:mm:ss

The parts of the displayed timestamp are the numeric values for the month, day, year, hour, minute, and second.

Depending on where the page set is accessed, the commit LRSN and read LRSN might not be available from the data sharing member that issues the command. When the commit LRSN or read LRSN is not available, N/A is displayed in the output.

The following example command displays the commit LRSN and the read LRSN for partition 1 of all table spaces whose names begin with TSNAME, in all databases whose names begin with DBNAME.

-DISPLAY DATABASE(DBNAME*) SPACENAM(TSNAME*) PART(1) LRSN

The output looks similar to this output:

DSNT360I -DB2A ***********************************
DSNT361I -DB2A * DISPLAY DATABASE SUMMARY
* GLOBAL
DSNT360I -DB2A ***********************************
DSNT362I -DB2A DATABASE = DBNAME1 STATUS = RW
DBD LENGTH = 383600
DSNT397I -DB2A
NAME     TYPE PART  LRSN                        TIMESTAMP
-------- ---- ----- --------------------------- ---------------------
TSNAME1  TS   1     COMMIT 00CD534D63D8BA000000 6/18/2016 15:23:49
                    READ   00CD535930B89F000000 6/18/2016 16:16:37
******* DISPLAY OF DATABASE DBNAME1 ENDED **********************
DSN9022I -DB2A DSNTDDIS 'DISPLAY DATABASE' NORMAL COMPLETION

End program-specific programming interface information.

End of change

DISPLAY THREAD SERVICE command for troubleshooting

Begin program-specific programming interface information.

The DISPLAY THREAD(*) SERVICE command helps to identify and rectify some CPU stalls. The following options are available:

SERVICE(WAIT)
Displays threads that are in a long-term suspend. If a thread is suspended on a latch, the command displays latch details, and Db2 attempts to boost the holder to relieve the latch contention. If the thread is suspended on a lock, the command displays lock detail information.
SERVICE(STG)
Displays the information for SERVICE(WAIT), with an additional message that outlines the agent local storage consumption for each thread displayed.

For more information, see -DISPLAY THREAD (Db2).End program-specific programming interface information.