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

Displaying User Sessions with onstat -u

You can find the session-id of the transaction by matching the address in the userthread column of the onstat -x output with the address column in the onstat -u output. The sessid column of the same line in the onstat -u output provides the session id. For example, Figure 87 shows the address a335898 in the userthread column of the onstat -x output. The output line in onstat -u with the same address shows the session id 15 in the sessid column.

Figure 87. Obtaining session-id for userthread in onstat -x
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 -u

address  flags    sessid  user     tty     wait     tout locks nreads   nwrites
a334018  ---P--D 1        informix -        0        0    0     20       6
a334638  ---P--F 0        informix -        0        0    0     0        1
a334c58  ---P--- 5        informix -        0        0    0     0        0
a335278  ---P--B 6        informix -        0        0    0     0        0
 a335898   Y--P---  15        informix 1        a843d70  0    2     64       0
a336af8  ---P--D 11       informix -        0        0    0     0        0
 6 active, 128 total, 17 maximum concurrent

For a transaction executing in loosely coupled mode, the first position of the flags column in the onstat -u output might display a value of T. This T value indicates that one branch within a global transaction is waiting for another branch to complete. This situation could occur if two different branches in a global transaction, both using the same database, tried to work on the same global transaction simultaneously.

For a transaction executing in tightly coupled mode, this T value does not occur because the database server shares one transaction structure for all branches that access the same database in the global transaction. Only one branch is attached and active at one time and does not wait for locks because the transaction owns all the locks held by the different branches.

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