Previous Topic

Next Topic

lockstat Command—Display Locking Status

Permission required: Installation owner.

The lockstat utility displays locking status information for your Ingres installation. It allows you to examine the state of the Lock Database by providing a summary listing and a snapshot of the installation's locking activity.

This tool is useful for finding lock contention and concurrency problems. It will help you identify locking bottlenecks so that you can correct the problem by setting lockmode appropriately or by remodeling the application if it is a fundamental design or program flow problem.

Note: The forms-based ipm utility incorporates the lockstat functions.

The lockstat command has the following format:

lockstat [-help | -summary | -statistics | -lists | -user_lists |
-special_lists | -resources]

Previous Topic

Next Topic

Lockstat Command Output

The key items to examine in lockstat output are the waiting statistics, including the following:

Note: The lockstat command gives detailed statistics on all locking activity in the installation, so if there is much activity, the quantity of output will be considerable.

Previous Topic

Next Topic

Lockstat Command Output – Locking System Quotas

The Locking System Quotas portion of the sample output is a summary listing of locking quotas for the installation. All values are cumulative from the time ingstart was run for this iteration of the system.

Here is sample output from this section:

===========Fri Apr 25 13:34:06    Locking System Quotas=========

  Total Locks          65000 Total Resources     65000

  Locks per transaction                             500

  Lock hash table      12983  Locks in use          129

  Resource hash table  12983  Resources in use      127

  Total lock lists      1480  Lock lists in use      57

Fields are as follows:

Previous Topic

Next Topic

Lockstat Command Output – Locking System Summary

The Locking System Summary portion of the sample output is a summary listing of locking activity for the installation. All values are cumulative from the time ingstart was run for this iteration of the system.

Here is sample output from this section:

===========Fri Nov 13 13:34:06    Locking System Summary========

  Create lock list   49395    Release lock list    49327

  Request lock      586295    Re-request lock     457810

  Convert lock       68157    Release lock        410846

  Escalate              10    Lock wait            27489

  Convert wait           2    Convert Deadlock         1

  Deadlock Wakeups    2218    Max dlk queue len       10

  Deadlock Search     1947    Deadlock               134

  Cancel               135    Convert Search           2

  Allocate CB      1161478    Deallocate CB      1160861

  LBK Highwater       3    LLB Highwater         87

  SBK Highwater       5    LKB Highwater        428

  RBK Highwater       5    RSB Highwater        420

  Max Local dlk srch  3    Dlk locks examined  2361

  Max rsrc chain len  5    Max lock chain len     5

  Callback Wakeups    0    Callbacks Invoked      0

  Callbacks Ignored   0

Fields are as follows:

The remaining fields are relevant only when the installation has been configured to run with the Distributed Multi-Cache Management (DMCM) protocol:

Previous Topic

Next Topic

Lockstat Command Output – Locks by Lock List

The "Locks by lock list" portion of the lockstat utility prints out the lock information sorted by lock list. The first line item reports the lock list identifier. Any locks associated with the specified lock list are listed following the lock list description and indented to set them off.

Most lock lists represent transaction units and hold the locks owned by their transactions. Some lock lists are used to hold special server or cache locks required for processing; these lock lists are owned and managed by the DBMS Server or recovery process rather than by user transactions.

Here is sample output from this section:

---------------------------Locks by lock list---------------------
Id: 00000001 Tran_id: 000000000000001A R_llb: 00000000 R_cnt: 0
Wait: 00000000 Locks: (0,0/250) Status: NONPROTECT,NOINTERRUPT PID: 10781 SID:0000000E
Id: 00000002 Tran_id: 0000000000000019 R_llb: 00000000 R_cnt: 0
Wait: 00000000 Locks: (0,0/250) Status: NONPROTECT,NOINTERRUPT PID: 10781 SID:00000009
Id: 00000003 Tran_id: 0000000000000018 R_llb: 00000000 R_cnt: 0
Wait: 00000000 Locks: (0,0/250) Status: NONPROTECT,NOINTERRUPT PID:
10781 SID:0000000C
Id: 00000004 Tran_id: 0000334C3362D62B R_llb: 00000000 R_cnt: 0
Wait: 00000000 Locks: (0,0/250) Status: NONPROTECT PID:
10781 SID:00000007
Id: 00000005 Tran_id: 0000000000000016 R_llb: 00000000 R_cnt: 0
Wait: 00000000 Locks: (0,0/250) Status: NONPROTECT,NOINTERRUPT PID:
10781 SID:00000007
Id: 00000006 Tran_id: 0000000000000015 R_llb: 00000000 R_cnt: 0
Wait: 00000000 Locks: (0,0/250) Status: NONPROTECT,NOINTERRUPT PID:
10781 SID:0000000B
Id: 00000007 Tran_id: 0000000000000014 R_llb: 00000000 R_cnt: 0
Wait: 00000000 Locks: (0,0/250) Status: NONPROTECT,NOINTERRUPT PID:
10781 SID:00000005
Id: 00000008 Tran_id: 0000000000000013 R_llb: 00000000 R_cnt: 0
Wait: 00000000 Locks: (0,0/250) Status: NONPROTECT,NOINTERRUPT PID: 10781 SID:00000006
Id: 00000009 Tran_id: 0000000000000012 R_llb: 00000000 R_cnt: 0
Wait: 00000000 Locks: (1,0/250) Status: NONPROTECT,NOINTERRUPT PID:
10781 SID:00000001
Id: 00000026 Rsb: 0000003C Gr: N Req: N State: GR PHYS(1)
KEY(AUDIT,LABEL_CACHE)
Id: 0000000A Tran_id: 0000000000000011 R_llb: 00000000 R_cnt: 0
Wait: 00000000 Locks: (0,0/0) Status: NONPROTECT,PSHARED PID:10781
SID:00000001

Id: 0000000B Tran_id: 0000000000000010 R_llb: 00000000 R_cnt: 0
Wait: 00000000 Locks: (95,0/250) Status: NONPROTECT,NOINTERRUPT,
SHARED PID:10781 SID:00000001

Id: 0000001F Rsb: 00000034 Gr: IS Req: IS State: GR PHYS(1)

Fields are as follows:

The values indented under individual lock lists are lock block values. These are described in the following table:

Previous Topic

Next Topic

Lockstat Command Output – Locks by Resource

The "Locks by resource" portion of lockstat groups the individual locks by resource block and shows any contention that can lead to query performance problems.

Here is sample output from this section:

---------------------------Locks by resource-----------------------

Id: 00000020 Gr: IS Conv: IS Cbacks 0 Value: <0000000000000002>

     KEY(SV_PAGE,DB=00000001,TABLE=[1,0],PAGE=3)

  Id: 0000000A Llb: 0000000B Gr: IS Req: IS State: GR PHYS(1)

Id: 00000021 Gr: IS Conv: IS Cbacks 0 Value: <0000000000000000>

     KEY(SV_PAGE,DB=00000001,TABLE=[1,0],PAGE=30)

  Id: 0000000B Llb: 0000000B Gr: IS Req: IS State: GR PHYS(1)

Id: 00000022 Gr: IS Conv: IS Cbacks 0 Value: <0000000000000000>

     KEY(SV_PAGE,DB=00000001,TABLE=[1,0],PAGE=2)

  Id: 0000000C Llb: 0000000B Gr: IS Req: IS State: GR PHYS(1)

Id: 00000023 Gr: IS Conv: IS Cbacks 0 Value: <0000000000000000>

     KEY(SV_PAGE,DB=00000001,TABLE=[1,0],PAGE=23)

  Id: 0000000D Llb: 0000000B Gr: IS Req: IS State: GR PHYS(1)

Id: 00000024 Gr: IS Conv: IS Cbacks 0 Value: <0000000000000000>

     KEY(SV_PAGE,DB=00000001,TABLE=[1,0],PAGE=1)

  Id: 0000000E Llb: 0000000B Gr: IS Req: IS State: GR PHYS(1)

Id: 00000025 Gr: IS Conv: IS Cbacks 0 Value: <0000000000000000>

     KEY(SV_PAGE,DB=00000001,TABLE=[1,0],PAGE=33)

  Id: 0000000F Llb: 0000000B Gr: IS Req: IS State: GR PHYS(1)

Fields are as follows:

The indented portions of the resource blocks show the individual lock blocks that are contending for the resource. These lock blocks are described in the following table:


© 2007 Ingres Corporation. All rights reserved.