Updated on 2024-06-03 GMT+08:00

V$SESSION_WAIT

V$SESSION_WAIT stores the current wait event or the last wait event of each session of each user. By default, only the system administrator can access this view. Common users can access the view only after being authorized. This view exists in the PG_CATALOG and SYS schemas.

Table 1 V$SESSION_WAIT columns

Name

Type

Description

sid

numeric

Session ID, which is mapped to the V$SESSION.SID column.

seq#

numeric

Not supported. Set it to NULL.

event

character varying(64)

If the session is waiting, the resource or event that is waiting for is displayed. If the session is not waiting, the resource or event that is waiting for the last time is displayed.

p1text

character varying(64)

Not supported. Set it to NULL.

p1

numeric

Not supported. Set it to NULL.

p1raw

raw

Not supported. Set it to NULL.

p2text

character varying(64)

Not supported. Set it to NULL.

p2

numeric

Not supported. Set it to NULL.

p2raw

raw

Not supported. Set it to NULL.

p3text

character varying(64)

Not supported. Set it to NULL.

p3

numeric

Not supported. Set it to NULL.

p3raw

raw

Not supported. Set it to NULL.

wait_class_id

numeric

Not supported. Set it to NULL.

wait_class#

numeric

Not supported. Set it to NULL.

wait_class

character varying(64)

Name of a wait event type

wait_time

numeric

If the session is waiting, the value is 0. If the session is not waiting, the options are as follows:
  • >0: duration of the last wait (unit: centisecond).
  • -1: The duration of the last wait is less than a centisecond.
  • -2: The TIMED_STATISTICS parameter is set to false.

This column has been deprecated and replaced by WAIT_TIME_MICRO and STATE.

seconds_in_wait

numeric

If the session is waiting, the value is the amount of time to wait. If the session is not waiting, the value is the amount of time since the last wait started.

This column has been deprecated and replaced by the WAIT_TIME_MICRO and TIME_SINCE_LAST_WAIT_MICRO columns.

state

character varying(19)

Waiting state. The options are as follows:
  • WAITING: The session is waiting.
  • WAITED UNKNOWN TIME: The duration of the last wait is unknown. This value is used when TIMED_STATISTICS is set to false.
  • WAITED SHORT TIME: The duration of the last wait is less than a centisecond.
  • WAITED KNOWN TIME: duration of the last wait specified in the WAIT_TIME column.

wait_time_micro

numeric

Wait time, in microseconds. If the session is waiting, the value is the time spent in the current wait. If the session is not waiting, the value is the time spent for the last wait.

time_remaining_micro

numeric

Not supported. Set it to NULL.

time_since_last_wait_micro

numeric

Time elapsed since the last wait ended, in microseconds. If the session is waiting, the value is 0.

con_id

numeric

Not supported. Set it to 0.