Oracle 视图 V$MUTEX_SLEEP_HISTORY 官方解释,作用,如何使用详细说明

本站中文解释

# Oracle 视图 V$MUTEX_SLEEP_HISTORY

V$MUTEX_SLEEP_HISTORY 视图展示了近期暂停共享资源的会话信息,其中包括会话标识符,会话系统创建时间以及该会话暂停访问共享资源的原因。使用这种视图,可以查看暂停访问共享资源的会话是否仍然存在。通过 V$MUTEX_SLEEP_HISTORY 这一视图,可以将会话对共享资源的暂停的事件记载下来,从而更好地反映出当前会话状态,并有助于诊断该系统中存在的性能问题。

V$MUTEX_SLEEP_HISTORY 视图以捕获现有会话持有共享资源时嵌套互斥体操作的信息,来监视各种共享资源。与此同时,视图也记录拥有此共享资源并等待着互斥体释放信号而导致会话暂停的会话信息。因此,当出现相同的互斥体访问冲突时,V$MUTEX_SLEEP_HISTORY 视图可以帮助我们识别问题的源头是什么,从而避免问题的继续发生。

使用 V$MUTEX_SLEEP_HISTORY 这一视图,可以查看暂停访问共享资源的会话的详细信息,如:

* MUTEX_TYPE — 表示所暂停的互斥体的类型;
* ADDRESS — 共享资源的地址,如果是字符串,则该字段为 NULL;
* HELD_COUNT — 表示会话拥有互斥体的次数;
* SLEEP_COUNT — 等待互斥体释放信号而导致会话暂停的次数;
* REQUESTOR_PID — 指定会话发出互斥体请求的进程 ID;
* REQUESTOR_SPID — 指定会话发出互斥体请求的系统进程 ID;
* REQUESTOR_SERIAL# — 标识发出互斥体请求的会话的序列号。

通过 V$MUTEX_SLEEP_HISTORY 视图,可以帮助我们有效地识别会话暂停共享资源的原因,并有效解决类似的性能问题。

官方英文解释

V$MUTEX_SLEEP_HISTORY displays time-series data.

Each row in this view is for a specific time, mutex type, location, requesting session and blocking session combination. That is, it shows data related to a specific session (requesting session) that slept while requesting a specific mutex type and location, because it was being held by a specific blocking session. The data in this view is contained within a circular buffer, with the most recent sleeps shown.

Column Datatype Description

MUTEX_IDENTIFIER

NUMBER

Mutex ID

SLEEP_TIMESTAMP

TIMESTAMP(6)

The last date/time this MUTEX_TYPE and LOCATION was slept for by the REQUESTING_SESSION, while being held by the BLOCKING_SESSION.

MUTEX_TYPE

VARCHAR2(32)

Type of action/object the mutex protects

GETS

NUMBER

The total number of gets since the mutex was created and up until the time of the wait (and from all sessions past and present)

SLEEPS

NUMBER

The number of times the requester had to sleep before obtaining the mutex

REQUESTING_SESSION

NUMBER

The SID of a session requesting the mutex

BLOCKING_SESSION

NUMBER

The SID of a session holding the mutex

LOCATION

VARCHAR2(40)

The code location where the waiter slept for the mutex

MUTEX_VALUE

RAW(4 | 8)

If the mutex is held in exclusive (X) mode, this column shows the SID of the blocking session, else it shows the number of sessions referencing the mutex in S mode.

P1

NUMBER

Reserved for internal use

P1RAW

RAW(4 | 8)

Reserved for internal use

P2

NUMBER

Reserved for internal use

P3

NUMBER

Reserved for internal use

P4

NUMBER

Reserved for internal use

P5

VARCHAR2(64)

Reserved for internal use

CON_ID

NUMBER

The ID of the container to which the data pertains. Possible values include:

  • 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.

  • 1: This value is used for rows containing data that pertain to only the root

  • n: Where n is the applicable container ID for the rows containing data


数据运维技术 » Oracle 视图 V$MUTEX_SLEEP_HISTORY 官方解释,作用,如何使用详细说明