This example demonstrates how to identify a possible lock
suspension problem using the Online Monitor thread activity function.
Display the Thread Summary panel by selecting option 1 (Display
Thread Activity) from the Online Monitor Main Menu.
Note: To view Class 3 times in the Thread Summary panel, you need
to scroll the display to the right (F20).
Type SORT on the command line and press Enter
to display the DB2® Thread Sort
Specification window, where you can sort threads by class 3 lock/latch
times in descending sequence so that threads with the most time spent
waiting because of lock and latch suspensions are sorted to the top.
You can also sort threads by class 3 lock/latch times in descending
sequence by typing the command SORT C3E and pressing
Enter on the command line.
For information about the SORT command see SORT command.
Press F3 (Exit) to exit the Db2 Thread Sort Specification window and return
to the Thread Summary panel.
At this point, all threads have been sorted in descending sequence
by class 3 lock/latch time, although this field is not displayed.
You can press the F20 (Right) key to view
class 3 times. The word SORT is displayed in the
header of the Thread Summary panel.
For example, to view detailed information about the class 3 lock
and latch times of a particular thread, type any character next to
that thread and press Enter. The Thread Detail panel is displayed.
Note: The
Thread Detail panel that you see might have been tailored by your
installation and consequently might not necessarily match the panel
examples shown in this information.
The Thread Detail panel shows that the thread is in LOCK status.
Select the 1 field to display the Thread Times window,
where you can examine the suspension time shown in the Locks
and latches field.
As you can see, most of the total class 3 suspension time is because
of locks and latches.
To view the locked resources associated with this thread, press F3 (Exit) to return to the Thread Detail panel
and select the Locked Resources field.
The Locked Resources window is displayed.
All locks held by the selected thread USERT003 are displayed.
You can see that a suspension has occurred for object MACBP2TB.
To view all users contending for the same object, type any character
next to that object and press Enter. The Threads Holding Resource
window is displayed.
All threads involved in the locking of this resource are displayed.
From this window, it can be seen that USERT001 is causing USERT003
to be suspended. This problem can be resolved if USERT001 uses the
SPUFI cursor stability plan (DSNESPCS), as does USERT003, instead
of the SPUFI repeatable read plan (DSNESPRR). You should decide whether
it is necessary for USERT001 to use DSNESPRR, or if DSNESPCS can be
used instead.