Analyzing Lockwaits with onstat (Informix)
Use
This procedure tells you how to find the cause of Informix database performance problems when sessions are waiting on locks held by other sessions, which is a common problem.
You can normally use the database monitor to identify the cause of this problem, as described in
Analyzing Lockwaits (Informix). Use the procedure described here to analyze lockwaits with onstat if there is no work process left for the monitor itself.Procedure
The following example shows the output from
onstat –u with one user holding a lock and two users waiting on that lock:address |
flags |
sessid |
user |
wait |
tout |
locks |
80705758 |
---P--D |
0 |
informix |
0 |
0 |
0 |
807178e0 |
Y-BP--- |
86 |
sapr3 |
8414a800 |
0 |
3 |
80717c48 |
L--PR-- |
89 |
sapr3 |
80886930 |
-1 |
2 |
80718318 |
L--PR-- |
88 |
sapr3 |
80886930 |
-1 |
2 |
80718680 |
Y—P--- |
17 |
sapr3 |
842e1b40 |
0 |
1 |
The following example shows the output from
onstat –k :address |
wtlist |
owner |
lklist |
type |
tblsnum |
80885558 |
0 |
80718d50 |
80885418 |
S |
100002 |
808862f0 |
0 |
80617c48 |
80887470 |
IX |
a001b3 |
80886908 |
0 |
80718318 |
0 |
S |
100002 |
80886930 |
80886930 |
807178e0 |
808878a8 |
HDR+X |
a001b3 |
808869f8 |
0 |
80718318 |
80886908 |
IX |
a001b3 |
|
. |
|||||
|
. |
onstat –u | grep L
onstat -k | grep <Wait>
onstat -u | grep <Owner>
This tells you which session is holding the lock.