Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Improving Individual Query Performance > Monitoring Transactions >

Displaying Locks with onstat -k

Use the onstat -k option to obtain more details on the locks that a transaction holds. To find the relevant locks, match the address in the userthread column in onstat -x to the address in the owner column of onstat -k. Figure 86 shows sample output from onstat -x and the corresponding onstat -k command. The a335898 value in the userthread column in onstat -x matches the value in the owner column of the two lines of onstat -k.

Figure 86. onstat -k and onstat -x Output
onstat -x

Transactions
address  flags userthread locks   beginlg curlog  logposit   isol    retrys coord
a366018  A---- a334018    0      0       1       0x22b048  COMMIT  0      
a3661f8  A---- a334638    0      0       0       0x0       COMMIT  0      
a3663d8  A---- a334c58    0      0       0       0x0       COMMIT  0      
a3665b8  A---- a335278    0      0       0       0x0       COMMIT  0      
a366798  A----  a335898     2      0       0       0x0       COMMIT  0      
a366d38  A---- a336af8    0      0       0       0x0       COMMIT  0      
 6 active, 128 total, 9 maximum concurrent

onstat -k 

Locks
address  wtlist    owner     lklist   type     tblsnum  rowid    key#/bsiz
a09185c  0         a335898   0        HDR+S    100002   20a         0   
a0918b0  0         a335898   a09185c  HDR+S    100002   204         0   
 2 active, 2000 total, 2048 hash buckets, 0 lock table overflows

In the example in Figure 86, a user is selecting a row from two tables. The user holds the following locks:

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]