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

本站中文解释

Oracle视图V$ENQUEUE_LOCK是用于跟踪通过数据库资源管理器构建的消息锁定对象的状态的一个系统视图。它用于监视当前数据库上所有在使用或可用的消息锁定资源,以及这些消息锁定资源的当前状态。

使用V$ENQUEUE_LOCK视图,可以确定运行的事务是否在等待锁定它想要的资源,或者,如果它已经拥有该资源,运行的事务是否正在用该资源执行工作。这可以用来确定哪些事务正在等待锁定,以及它们是否可以立即释放所锁定的资源,以便其他事务可以访问它们。

要使用V$ENQUEUE_LOCK视图,您只需在SQL*Plus或另一个SQL客户端中执行SELECT语句,并根据您需要调整参数,即可查看当前数据库中可用的消息锁定资源的状态。例如,以下语句可返回V$ENQUEUE_LOCK视图中包含的字段:

SELECT * FROM V$ENQUEUE_LOCK;

官方英文解释

V$ENQUEUE_LOCK displays all locks owned by enqueue state objects. The columns in this view are identical to the columns in V$LOCK.

See Also:

“V$LOCK”

Column Datatype Description

ADDR

RAW(4 | 8)

Address of lock state object

KADDR

RAW(4 | 8)

Address of lock

SID

NUMBER

Identifier for session holding or acquiring the lock

TYPE

VARCHAR2(2)

Type of lock. Lists user and system types that can have locks.

ID1

NUMBER

Lock identifier #1 (depends on type)

ID2

NUMBER

Lock identifier #2 (depends on type)

LMODE

NUMBER

Lock mode in which the session holds the lock:

  • 0 – none

  • 1 – null (NULL)

  • 2 – row-S (SS)

  • 3 – row-X (SX)

  • 4 – share (S)

  • 5 – S/Row-X (SSX)

  • 6 – exclusive (X)

REQUEST

NUMBER

Lock mode in which the process requests the lock:

  • 0 – none

  • 1 – null (NULL)

  • 2 – row-S (SS)

  • 3 – row-X (SX)

  • 4 – share (S)

  • 5 – S/Row-X (SSX)

  • 6 – exclusive (X)

CTIME

NUMBER

Time since current mode was granted

BLOCK

NUMBER

The lock is blocking another lock

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$ENQUEUE_LOCK 官方解释,作用,如何使用详细说明