Note
This view is available starting with V1.4.
Purpose
This view displays the information about the 10 most recent wait events for all sessions on the current OBServer node.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SID | bigint(20) | NO | For V4.2.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. |
| SEQ# | bigint(20) | NO | The sequence number of the wait event. |
| EVENT# | bigint(20) | NO | The number of the wait event. |
| EVENT | varchar(64) | NO | The name of the wait event. |
| P1TEXT | varchar(64) | NO | The description of parameter 1 of the wait event. |
| P1 | bigint(20) unsigned | NO | The value of parameter 1 of the wait event. |
| P2TEXT | varchar(64) | NO | The description of parameter 2 of the wait event. |
| P2 | bigint(20) unsigned | NO | The value of parameter 2 of the wait event. |
| P3TEXT | varchar(64) | NO | The description of parameter 3 of the wait event. |
| P3 | bigint(20) unsigned | NO | The value of parameter 3 of the wait event. |
| WAIT_TIME | double | NO | The wait time of the wait event, in hundredths of a second. |
| WAIT_TIME_MICRO | bigint(20) | NO | The wait time of the wait event, in microseconds. |
| TIME_SINCE_LAST_WAIT_MICRO | bigint(20) | NO | The time elapsed since the last wait ended, in microseconds. |
Sample query
Query the information about the 10 most recent wait events for all sessions in the current tenant on the current OBServer node.
obclient [oceanbase]> SELECT * FROM oceanbase.V$SESSION_WAIT_HISTORY;
The query result is as follows:
+------------+--------+----------------+----------+------+--------+-------+--------+------+--------+------+--------+------+-------------------+------------------+----------------------------+
| SID | CON_ID | SVR_IP | SVR_PORT | SEQ# | EVENT# | EVENT | P1TEXT | P1 | P2TEXT | P2 | P3TEXT | P3 | WAIT_TIME | WAIT_TIME_MICRO | TIME_SINCE_LAST_WAIT_MICRO |
+------------+--------+----------------+----------+------+--------+-------+--------+------+--------+------+--------+------+-------------------+------------------+----------------------------+
| 3221661914 | 1002 | 11.xxx.xxx.xxx | 2882 | 1 | 0 | | | 0 | | 0 | | 0 | 174315142799.6285 | 1743151427996285 | 0 |
+------------+--------+----------------+----------+------+--------+-------+--------+------+--------+------+--------+------+-------------------+------------------+----------------------------+
1 row in set