8.40 V$LOCK

V$LOCK lists the locks currently held by the Oracle Database and outstanding requests for a lock or latch.

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 user or system lock

The locks on the user types are obtained by user applications. Any process that is blocking others is likely to be holding one of these locks. The user type locks are:

TM - DML enqueue

TX - Transaction enqueue

UL - User supplied

The system type locks are listed in Table 8-1. Be aware that not all types of locks are documented. To find a complete list of locks for the current release, query the V$LOCK_TYPE data dictionary view, described on "V$LOCK_TYPE".

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

Indicates whether the lock in question is blocking other processes. The possible values are:

0 - The lock is not blocking any other processes

1 - The lock is blocking other processes

2 - The lock is not blocking any blocked processes on the local node, but it may or may not be blocking processes on remote nodes. This value is used only in Oracle Real Application Clusters (Oracle RAC) configurations (not in single instance configurations).

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