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

本站中文解释

Oracle视图V$LIBCACHE_LOCKS用于描述当前数据库实例正在使用的进程对应的共享池对象锁定的信息。

此视图中的每条记录对应一个正在使用的池对象锁。视图中的信息有:锁所属的数据库实例、锁的类型、共享池对象的类型和数据库的逻辑读写地址等。比如,可以通过查询此视图,查找所有用户字典缓存上的共享池锁定信息。

使用V$LIBCACHE_LOCKS视图,可以优化系统性能,看到池锁定对象的实际使用情况,帮助系统优化器为SQL语句选择一组最优计划。另外,也可以用它检查系统内部的瓶颈,通过查看池对象的锁定情况找到原因,从而及时解决问题。

官方英文解释

V$LIBCACHE_LOCKS displays information about the library cache locks and pins. Locks and pins are distinguished based on the value of the TYPE column.

Column Datatype Description

TYPE

VARCHAR2(4)

LOCK or PIN

ADDR

RAW(4 | 8)

Address of the lock/pin

HOLDING_USER_SESSION

RAW(4 | 8)

User session holding this lock/pin

HOLDING_SESSION

RAW(4 | 8)

Session holding this lock/pin

OBJECT_HANDLE

RAW(4 | 8)

Handle address for which the lock/pin is acquired

LOCK_HELD

RAW(4 | 8)

If the type is LOCK, then LOCK_HELD represents the pin that is pinning the object.

If the type is PIN, then LOCK_HELD represents the lock that is locking the object.

REFCOUNT

NUMBER

Reference count for this lock/pin

MODE_HELD

NUMBER

Lock/pin mode held:

  • 0 – No lock/pin held

  • 1 – Null mode

  • 2 – Share mode

  • 3 – Exclusive mode

MODE_REQUESTED

NUMBER

Lock/pin mode requested:

  • 0 – No lock/pin requested

  • 1 – Null mode

  • 2 – Share mode

  • 3 – Exclusive mode

SAVEPOINT_NUMBER

NUMBER

Kernel transaction savepoint number at the time the lock/pin was acquired

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