Start of Content Area

Procedure documentation Analyzing Lockwaits with onstat (Informix)  Locate the document in its SAP Library structure

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

  1. Enter the command onstat -u to display user activity.
  2. 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

  3. Enter the command onstat -k to display active locks.
  4. 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

         

    .

       
         

    .

       
  5. Link the information in the above displays as follows:
    1. Look for sessions that are waiting on a lock as follows:
    2. onstat –u | grep L

    3. Use the value displayed in the column Wait as follows:
    4. onstat -k | grep <Wait>

    5. Use the value displayed in the Owner column as follows:

onstat -u | grep <Owner>

This tells you which session is holding the lock.