Wednesday, September 10, 2008

V$LOCKED_OBJECT

Oracle 11gR1

V$LOCKED_OBJECT lists all locks acquired by every transaction on the system. It shows which sessions are holding DML locks (that is, TM-type enqueues) on what objects and in what mode.

Column

Datatype

Description

XIDUSN

NUMBER

Undo segment number

XIDSLOT

NUMBER

Slot number

XIDSQN

NUMBER

Sequence number

OBJECT_ID

NUMBER

Object ID being locked

SESSION_ID

NUMBER

Session ID

ORACLE_USERNAME

VARCHAR2(30)

Oracle user name

OS_USER_NAME

VARCHAR2(30)

OS user name

PROCESS

VARCHAR2(12)

OS process ID

LOCKED_MODE

NUMBER

Lock mode

Note:

1. Show locked objects

select oracle_username || ' (' || s.osuser || ')' username

, s.sid || ',' || s.serial# sess_id

, owner || '.' || object_name object

, object_type

, decode( l.block

, 0, 'Not Blocking'

, 1, 'Blocking'

, 2, 'Global') status

, decode(v.locked_mode

, 0, 'None'

, 1, 'Null'

, 2, 'Row-S (SS)'

, 3, 'Row-X (SX)'

, 4, 'Share'

, 5, 'S/Row-X (SSX)'

, 6, 'Exclusive', TO_CHAR(lmode)) mode_held

from v$locked_object v

, dba_objects d

, v$lock l

, v$session s

where v.object_id = d.object_id

and v.object_id = l.id1

and v.session_id = s.sid

order by oracle_username

, session_id;

Oracle dynamic performance views

Oracle data dictionary views

No comments:

Post a Comment