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 event number. |
| EVENT | varchar(64) | NO | The event name. |
| 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
In the sys tenant, query the information about the 10 most recent wait events for all sessions 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 |
+----------------------+--------+----------------+----------+------+--------+-------+--------+------+--------+------+--------+------+-------------------+------------------+----------------------------+
| -9223372036854775604 | 1 | 11.xxx.xxx.xxx | 28825 | 1 | 0 | | | 0 | | 0 | | 0 | 174315105890.7662 | 1743151058907662 | 0 |
+----------------------+--------+----------------+----------+------+--------+-------+--------+------+--------+------+--------+------+-------------------+------------------+----------------------------+
1 row in set
