You can view information about sessions, lock usage, and
lock waits.
About this task
If the application executes SET LOCK MODE TO WAIT, the
database server waits for a lock to be released instead of returning
an error. An unusually long wait for a lock can give users the impression
that the application is hanging.
In onstat -u output that shows
lock usage, the onstat -u output
shows that session ID 84 is waiting for a lock (L in
the first column of the Flags field). To find out the owner
of the lock, use the onstat -k command.
To find out the owner of the lock for which session
ID 84 is waiting:
Procedure
Obtain the address of the lock in the wait field
(300b78d8) of the onstat -u output.
Find this address (300b78d8) in the Locks
address field of the onstat -k output.
The owner field
of this row in the onstat -k output contains the address of
the user thread (40074140).
Find this address (40074140) in the Userthreads field
of the onstat -u output.
The sessid field
of this row in the onstat -u output contains the session ID
(81) that owns the lock.
Results
To eliminate the contention problem, you can have the
user exit the application gracefully. If this solution is not possible,
you can stop the application process or remove the session with onmode
-z.