Note
This view is available starting with V1.4.
Purpose
The GV$SESSION_WAIT view displays information about the current or last wait events of all sessions on all nodes, including the event name, wait time, and other parameters.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SID | bigint(20) | NO | For V4.3.x:
|
| 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 status 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 time that has been spent waiting. If the session is not 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 information about the current or last wait events of all sessions on all nodes.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$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: -360944228277398966
