Note
This view is available starting with V1.4.
Purpose
The V$SESSION_WAIT view displays the details of current wait events for all sessions on the current node. By convention, each wait event has three parameters, and the corresponding values are recorded for each parameter.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SID | bigint(20) | NO | For V4.3.x versions:
|
| CON_ID | bigint(20) | NO | The tenant ID. |
| SVR_IP | varchar(46) | NO | The IP address of the server. |
| SVR_PORT | bigint(20) | NO | The port number of the server. |
| EVENT | varchar(64) | NO | The name of the wait event. |
| P1TEXT | varchar(64) | NO | The description of the first parameter of the wait event. |
| P1 | bigint(20) unsigned | NO | The value of the first parameter of the wait event. |
| P2TEXT | varchar(64) | NO | The description of the second parameter of the wait event. |
| P2 | bigint(20) unsigned | NO | The value of the second parameter of the wait event. |
| P3TEXT | varchar(64) | NO | The description of the third parameter of the wait event. |
| P3 | bigint(20) unsigned | NO | The value of the third parameter of the wait event. |
| WAIT_CLASS_ID | bigint(20) | NO | The ID of the wait event category. |
| WAIT_CLASS# | bigint(20) | NO | The sequence number of the wait event category. |
| WAIT_CLASS | varchar(64) | NO | The name of the wait event category. |
| STATE | varchar(19) | NO | The current state of the wait event. Valid values:
|
| WAIT_TIME_MICRO | bigint(20) | NO | The wait time in microseconds. If the session is currently waiting, this field indicates the duration of the wait. If the session is not currently waiting, this field indicates the total wait time of the last wait. |
| TIME_REMAINING_MICRO | bigint(20) | NO |
|
| TIME_SINCE_LAST_WAIT_MICRO | bigint(20) | NO | The time elapsed since the last wait ended, in microseconds. If the session is currently waiting, this field is 0. |
Sample query
Query the details of current wait events for all sessions on the current node.
obclient [oceanbase]> SELECT * FROM oceanbase.V$SESSION_WAIT LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
SID: 3221608040
CON_ID: 1
SVR_IP: xx.xx.xx.xx
SVR_PORT: 2882
EVENT: wait in request queue
P1TEXT: pcode
P1: 0
P2TEXT: level
P2: 0
P3TEXT: priority
P3: 0
WAIT_CLASS_ID: 102
WAIT_CLASS#: 2
WAIT_CLASS: CONFIGURATION
STATE: WAITED SHORT TIME
WAIT_TIME_MICRO: 12
TIME_REMAINING_MICRO: -1
TIME_SINCE_LAST_WAIT_MICRO: -360944227905046389
