Monitoring byte-range locks

You can use onstat -k to list all byte-range locks. Use the onstat -K command to list byte-range locks and all waiters for byte-range locks.

Byte-range locks in onstat -k output shows an excerpt from the output of onstat -k.
Figure 1: Byte-range locks in onstat -k output
Byte-Range Locks
rowid/LOid   tblsnum  address  status   owner    offset   size     type
104          200004   a020e90  HDR
[2, 2, 3]             a020ee4  HOLD     a1b46d0  50       10           S 
202          200004   a021034  HDR
[2, 2, 5]             a021088  HOLD     a1b51e0  40       5            S 
102          200004   a035608  HDR
[2, 2, 1]             a0358fc  HOLD     a1b4148  0        500          S 
                      a035758  HOLD     a1b3638  300      100          S 
 21 active, 2000 total, 2048 hash buckets 

Byte-range locks produce the following information in the onstat -k output.

Column Description
rowid The rowid of the row that contains the locked smart large object
LOid The three values: sbspace number, chunk number, and sequence number (a value that represents the position in the chunk)
tblsnum The number of the tblspace that holds the smart large object
address The address of the lock
status The status of the lock

HDR is a placeholder. HOLD indicates the user specified in the owner column owns the lock. WAIT (shown only with onstat -K) indicates that the user specified in the owner column is waiting for the lock.

owner The address of the owner (or waiter)

Cross reference this value with the address in onstat -u.

offset The offset into the smart large object where the bytes are locked
size The number of bytes locked, starting at the value in the offset column
type S (shared lock) or X (exclusive)