Home | Previous Page | Next Page   Appendix C. onstat Command Reference > onstat -g Command Summary >

onstat -k

The onstat -k command displays information about active locks.

The following example shows output from the onstat -k command:

Locks
address  wtlist   owner    lklist   type     tblsnum  rowid    key#/bsiz
a095f78  0        a4d9e68  0        HDR+S    100002   203         0   

In the following output, the number 2 in the last row shows an Enterprise Replication pseudo lock:

Locks 
address  wtlist    owner    lklist   type    tblsnum  rowid    key#/bsiz
a197ff8  0         5c2db4a8 0           S    100002   204              0 
a198050  0         5c2db4a8 a197ff8     S    100002   205              0 
a198260  0         5c2f2248 0           S    100002   204              0 
a198470  0         5c2e6b78 a198520     S    100002   205              0 
a198520  0         5c2e6b78 0           S    100002   204              0 
a1986d8  0         5c2ec6e0 a198ba8     S    100002   205              0 
a198ba8  0         5c2ec6e0 0           S    100002   204              0 
a1993e8  0         5c2f03d0 a19be30     S         2   1c05a            0

You can interpret output from this option as follows:

address
Is the address of the lock in the lock table

If a user thread is waiting for this lock, the address of the lock appears in the wait field of the onstat -u (users) output.

wtlist
Is the first entry in the list of user threads that is waiting for the lock, if there is one
owner
Is the shared-memory address of the thread that is holding the lock

This address corresponds to the address in the address field of onstat -u (users) output.

lklist
Is the next lock in a linked list of locks held by the owner just listed
type
Uses the following codes to indicate the type of lock:
HDR
Header
B
Bytes
S
Shared
X
Exclusive
I
Intent
U
Update
IX
Intent-exclusive
IS
Intent-shared
SIX
Shared, intent-exclusive
tblsnum
Is the tblspace number of the locked resource. If the number is less than 10000, it indicates Enterprise Replication pseudo locks.
rowid
Is the row identification number

The rowid provides the following lock information:

  • If the rowid equals zero, the lock is a table lock.
  • If the rowid ends in two zeros, the lock is a page lock.
  • If the rowid is six digits or fewer and does not end in zero, the lock is probably a row lock.
  • If the rowid is more than six digits, the lock is probably an index key-value lock.
key#/bsiz
Is the index key number, or the number of bytes locked for a VARCHAR lock

If this field contains 'K-' followed by a value, it is a key lock. The value identifies which index is being locked. For example, K-1 indicates a lock on the first index defined for the table.

The maximum number of locks available is specified as LOCKS in the ONCONFIG file.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]