Note
This view is available starting with V1.4.
Purpose
This view displays the details of the current or previous wait events for all sessions of the current tenant on the current OBServer node. By convention, each wait event has three parameters, each of which records the corresponding value.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SID | bigint(20) | NO | For V4.2.x versions:
|
| CON_ID | bigint(20) | NO | Tenant ID |
| SVR_IP | varchar(46) | NO | Server IP address |
| SVR_PORT | bigint(20) | NO | Server port |
| EVENT | varchar(64) | NO | Name of the wait event |
| P1TEXT | varchar(64) | NO | Description of the first parameter of the wait event |
| P1 | bigint(20) unsigned | NO | Value of the first parameter of the wait event |
| P2TEXT | varchar(64) | NO | Description of the second parameter of the wait event |
| P2 | bigint(20) unsigned | NO | Value of the second parameter of the wait event |
| P3TEXT | varchar(64) | NO | Description of the third parameter of the wait event |
| P3 | bigint(20) unsigned | NO | Value of the third parameter of the wait event |
| WAIT_CLASS_ID | bigint(20) | NO | ID of the wait event category |
| WAIT_CLASS# | bigint(20) | NO | Number of the wait event category |
| WAIT_CLASS | varchar(64) | NO | Name of the wait event category |
| STATE | varchar(19) | NO | Status of the current wait event. Valid values: |
| WAIT_TIME_MICRO | bigint(20) | NO | Wait time in microseconds. If the session is waiting, this value indicates the duration of the wait. If the session is not waiting, this value indicates the total wait time of the last wait. |
| TIME_REMAINING_MICRO | bigint(20) | NO | |
| TIME_SINCE_LAST_WAIT_MICRO | bigint(20) | NO | Time elapsed since the last wait ended, in microseconds. If the session is waiting, this value is 0. |
Sample query
Query the details of the current or previous wait events for all sessions of the current tenant on the current node, and display the first two records.
obclient [oceanbase]> SELECT * FROM oceanbase.V$SESSION_WAIT LIMIT 2\G
The query result is as follows:
*************************** 1. row ***************************
SID: 3221554030
CON_ID: 1002
SVR_IP: 11.xxx.xxx.xxx
SVR_PORT: 28825
EVENT: exec inner sql wait
P1TEXT: wait inner sql class
P1: 0
P2TEXT: inner session id
P2: 9223372037041564425
P3TEXT:
P3: 0
WAIT_CLASS_ID: 100
WAIT_CLASS#: 0
WAIT_CLASS: OTHER
STATE: WAITED SHORT TIME
WAIT_TIME_MICRO: 10
TIME_REMAINING_MICRO: -1
TIME_SINCE_LAST_WAIT_MICRO: -98899914482593272
*************************** 2. row ***************************
SID: -9223372036854727872
CON_ID: 1002
SVR_IP: 11.xxx.xxx.xxx
SVR_PORT: 28825
EVENT: db file compact write
P1TEXT: schedule_queue_delay
P1: 19
P2TEXT: device_delay
P2: 159
P3TEXT: callback_delay
P3: 0
WAIT_CLASS_ID: 109
WAIT_CLASS#: 9
WAIT_CLASS: SYSTEM_IO
STATE: WAITED SHORT TIME
WAIT_TIME_MICRO: 140
TIME_REMAINING_MICRO: NULL
TIME_SINCE_LAST_WAIT_MICRO: -98893816462565364
2 rows in set
References
View all wait events at the session level:
- For more information about wait events, see Common wait events.