查看锁的几个视图

DBA_LOCK lists all locks or latches held in the database, and all outstanding requests for a lock or latch.

Column Datatype NULL Description
SESSION_ID NUMBER   Session holding or acquiring the lock
LOCK_TYPE VARCHAR2(26)   Lock type

See Also: For a listing of lock types, see Appendix D, "Oracle Enqueue Names"

MODE HELD VARCHAR2(40)   Lock mode
MODE REQUESTED VARCHAR2(40)   Lock mode requested
LOCK_ID1 VARCHAR2(40)   Type-specific lock identifier, part 1
LOCK_ID2 VARCHAR2(40)   Type-specific lock identifier, part 2
LAST_CONVERT NUMBER   The last convert
BLOCKING_OTHERS VARCHAR2(40)   Whether the lock is currently blocking others


DBA_DML_LOCKS lists all DML locks held in the database and all outstanding requests for a DML lock.

Column Datatype NULL Description
SESSION_ID NUMBER   Session holding or acquiring the lock
OWNER VARCHAR2(30) NOT NULL Owner of the lock
NAME VARCHAR2(30) NOT NULL Name of the lock
MODE_HELD VARCHAR2(13)   The type of lock held. The values are:
  • ROWS_S (SS): row share lock

  • ROW-X (SX): row exclusive lock

  • SHARE (S): share lock

  • S/ROW-X (SSX): exclusive lock

  • NONE: lock requested but not yet obtained

MODE_REQUESTED VARCHAR2(13)   Lock request type. The values are:
  • ROWS_S (SS): row share lock

  • ROW-X (SX): row exclusive lock

  • SHARE (S): share lock

  • S/ROW-X (SSX): exclusive lock

  • NONE: Lock identifier obtained; lock not held or requested

LAST_CONVERT NUMBER   The last convert
BLOCKING_OTHERS VARCHAR2(40)   Blocking others



DBA_DDL_LOCKS lists all DDL locks held in the database and all outstanding requests for a DDL lock.

Column Datatype NULL Description
SESSION_ID NUMBER   Session identifier
OWNER VARCHAR2(30)   Owner of the lock
NAME VARCHAR2(30)   Name of the lock
TYPE VARCHAR2(40)   Lock type:
  • Cursor

  • Table/Procedure/Type

  • Body

  • Trigger

  • Index

  • Cluster

  • Java Source

  • Java Resource

  • Java Data

MODE_HELD VARCHAR2(9)   Lock mode:
  • None

  • Null

  • Share

  • Exclusive

MODE_REQUESTED VARCHAR2(9)   Lock request type:
  • None

  • Null

  • Share

  • Exclusive






DBA_WAITERS shows all the sessions that are waiting for a lock.

Column Datatype NULL Description
WAITING_SESSION NUMBER   The waiting session
HOLDING_SESSION NUMBER   The holding session
LOCK_TYPE VARCHAR2(26)   The lock type
MODE_HELD VARCHAR2(40)   The mode held
MODE_REQUESTED VARCHAR2(40)   The mode requested
LOCK_ID1 VARCHAR2(40)   Lock ID 1
LOCK_ID2 VARCHAR2(40)   Lock ID 2




DBA_BLOCKERS displays a session if it is not waiting for a locked object but is holding a lock on an object for which another session is waiting.

Column Datatype NULL Description
HOLDING_SESSION NUMBER   Session holding a lock



Reference

你可能感兴趣的:(oracle,锁)