Updated on 2024-05-07 GMT+08:00

V$SESSION_WAIT

V$SESSION_WAIT displays 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 both PG_CATALOG and SYS schema.

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. Its value is 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. Its value is NULL.

p1

numeric

Not supported. Its value is NULL.

p1raw

raw

Not supported. Its value is NULL.

p2text

character varying(64)

Not supported. Its value is NULL.

p2

numeric

Not supported. Its value is NULL.

p2raw

raw

Not supported. Its value is NULL.

p3text

character varying(64)

Not supported. Its value is NULL.

p3

numeric

Not supported. Its value is NULL.

p3raw

raw

Not supported. Its value is NULL.

wait_class_id

numeric

Not supported. Its value is NULL.

wait_class#

numeric

Not supported. Its value is 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. Its value is 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. Its value is 0.