onstat -g ses command: Print session-related information
Use the onstat -g ses command to display information about the session.
By
default, only the DBSA can view onstat -g ses information.
However, when the UNSECURE_ONSTAT configuration parameter is set to 1
,
all users can view this information.
You can specify one of the following invocations.
- onstat -g ses
- Displays a one-line summary for each session
- onstat -g ses session_id
- Displays information for a specific session
Example output for all sessions
Output description: session section
- Session id
- The session ID
- user
- The user who started the session
- tty
- The tty that is associated with the front end for this session
- pid
- The process ID associated with the front end for this session
- hostname
- The hostname from which this session connected
- #RSAM threads
- The number of RSAM thread that is allocated for this session
- total memory
- The amount of memory that is allocated for this session
- used memory
- The amount of memory that is actually used by this session
- dynamic explain
- Generate explain output of the SQL statements of the session (
on
oroff
)
Output description: Last 20 Sessions Terminated section
- Ses ID
- The session ID
- Username
- The user who started the session
- Hostname
- The hostname from which this session connected
- PID
- The process ID associated with the front end for this session
- Time
- The time at which the session was terminated.
- Reason
- The limit that was exceeded, followed by the limit value in parentheses.
Example output for a specific session
Output description: program section
Displays the full path of the client program that is used in your session. Use the client program information to monitor or stop access to the database.
Output description: threads section
Although this section has no title, the following output displays information about threads.
- tid
- The thread ID
- name
- The name of the thread
- rstcb
- RSAM control block
- flags
- Describes the status of the thread using the following codes:
Position 1
- B
- Waiting on a buffer
- C
- Waiting on a checkpoint
- G
- Waiting on a logical-log buffer write
- L
- Waiting on a lock
- S
- Waiting on a mutex
- T
- Waiting on a transaction
- X
- Waiting on a transaction cleanup
- Y
- Waiting on a condition
Position 2
- *
- An asterisk in this position means that the thread encountered an I/O failure in the middle of a transaction
Position 3
- A
- Archive thread
- B
- Begin work
- P
- Begin Prepare or Prepared work
- X
- XA prepared
- C
- Committing or committed
- R
- Aborting or aborted
- H
- Heuristically aborted or heuristically rolling back
Position 4
- P
- Primary thread
Position 5
- R
- Reading
- X
- Critical section
Position 6
- R
- Recovery thread
Position 7
- M
- Monitor thread
- D
- Daemon thread
- C
- Cleaner
- F
- Flusher
- B
- B-tree scanner
- curstk
- Current® stack size
- status
- Current thread status
Output description: memory pools header section
The information is repeated for each session pool.
- name
- Name of pool
- class
- Class of the memory where the pool is allocated from. R is for Resident, V is for Virtual, and M is for Message
- addr
- Address of the pool structure
- totalsize
- Total size of the memory that is acquired by the pool (in bytes)
- freesize
- Number of bytes free in the pool
- #allocfrag
- Number of allocated memory fragments in the pool
- #freefrag
- Number of free fragments in the pool
Output description: Memory pools section
- name
- Name of a component which allocated memory from the pool
- free
- Number of bytes freed
- used
- Number of bytes allocated
Output description: sqscb info section
- scb
- The session control block. This is the address of the main session structure in shared memory
- sqscb
- SQL level control block of the session
- optofc
- The current value of the OPTOFC environment variable or ONCONFIG configuration file setting
- pdqpriority
- The current value of the PDQPRIORITY environment variable or ONCONFIG configuration file setting
- optcompind
- The current value of the OPTCOMPIND environment variable or ONCONFIG configuration file setting
- directives
- The current value of the DIRECTIVES environment variable or ONCONFIG configuration file setting
Output description: SQL section
Displays SQL information for the specified session. This section contains the same information that is output from the onstat -g sql command. See onstat -g sql command: Print SQL-related session information.
Output description: Last parsed SQL statement section
The Last parsed SQL statement section contains the same information that is output from the onstat -g sql command. See onstat -g sql command: Print SQL-related session information.
Output description: Xadatasources participated in this session section
- Xdatasource name
- The XA data source that participated in the session
- RMID
- The identifier of the resource manager for the corresponding XA data source
- Active
- Whether the XA data source is still active
Output description: DRDA® client info section
- Userid
- User ID of the client user
- Wrkstnname
- Name of the client workstation
- Applname
- Name of the client application, for example
db2jcc_application
- Acctng
- Accounting string from the client, for example
JCC03510nemea
- Programid
- Client program identifier (not used by HCL OneDB™)
- Autocommit
- Default transaction autocommit mode for HCL OneDB data sources
- Packagepath
- Client package path (not used by HCL OneDB)
Output description: Session limits section
- Locks
- The session's number of locks.
- Memory(KB)
- The session's memory.
- Temp Space(KB)
- The session's temporary table space.
- Log Space(KB)
- Log space for single transactions.
- Txn Time(s)
- Duration of single transactions.