onstat -u command: Print user activity profile
Use the onstat -u command to display a profile of user activity.
Example output
Output description
- address
- The shared-memory address of the user thread in the user table.
Compare this address with the addresses displayed in the output from the -s option (latches); the output from the -b, -B, and -X options (buffers); and the output from the -k option (locks) to learn what resources this thread is holding or waiting for.
- flags
- Provides the status of the session. The flag codes for position 1:
- B
- Waiting for a buffer
- C
- Waiting for a checkpoint
- G
- Waiting for a write of the logical-log buffer
- L
- Waiting for a lock
- S
- Waiting for mutex
- T
- Waiting for a transaction
- Y
- Waiting for condition
- X
- Waiting for a transaction cleanup (rollback)
- DEFUNCT
- The thread has incurred a serious assertion failure, and has been suspended to allow other threads to continue their work.
The flag code for position 2:- *
- Transaction active during an I/O failure
The flag code for position 3:- A
- A dbspace backup thread
For other values that appear here, see the third position of flag codes for the -x option.
The flag code for position 4:- P
- Primary thread for a session
The flag codes for position 5:- R
- Reading
- X
- Thread in critical section
The flag codes for position 6:- R
- Thread used in recovery (for example, physical or logical recovery)
- -
- Thread not used in recovery
The flag codes for position 7:- B
- A B-tree cleaner thread
- C
- Terminated user thread waiting for cleanup
- D
- A daemon thread
- F
- A page-cleaner thread
- sessid
- The session identification number.
During operations such as parallel sorting and parallel index building, a session might have many user threads associated with it. For this reason, the session ID identifies each unique session.
- user
- The user login name, which is derived from the operating system
- tty
- The name of the standard error (stderr) file that the user is
using, which is derived from the operating system.
This field is blank on Windows™.
- wait
- If the user thread is waiting for a specific latch, lock, mutex, or condition, this field displays the address of the resource. Use this address to map to information provided in the output from the -s (latch) option or the -k (lock) option. If the wait is for a persistent condition, run a grep for the address in the output from the onstat -a command.
- tout
- The number of seconds left in the current wait
If the value is
0
, the user thread is not waiting for a latch or lock. If the value is-1
, the user thread is in an indefinite wait. - locks
- The number of locks that the user thread is holding
The -k output should include a listing for each lock held.)
- nreads
- The number of disk reads that the user thread has executed
- nwrites
- The number of write calls that the user thread has executed
All write calls are writes to the shared-memory buffer cache.
4 active, 128 total, 17 maximum concurrent
The
last part of the line, 17 maximum concurrent
, indicates
that the maximum number of user threads that were running concurrently
since you initialized the database server is 17.
The output also indicates the number of active users and the maximum number of users allowed.