LOCKINGS

ORACLE LOCKINGS


— FOR LOCKED OBJECTS
SELECT ORACLE_USERNAME
OS_USER_NAME,
LOCKED_MODE,
OBJECT_NAME,
OBJECT_TYPE
FROM V$LOCKED_OBJECT LO,DBA_OBJECTS DO
WHERE LO.OBJECT_ID = DO.OBJECT_ID;

— FOR LOCKED USERS
SELECT S.USERNAME,
S.SID,
L.TYPE,
L.LMODE,
L.REQUEST
FROM V$LOCK L, V$SESSION S
WHERE L.SID = S.SID;

SELECT USERNAME,
ACCOUNT_STATUS,
LOCK_DATE
FROM DBA_USERS
WHERE USERNAME=’ALEX’;


Query the “v$locked_object” table for additional information about what is locked. Join with the “dba_objects” table for name and type. The object name indicates what is locked and the username columns identify who has created the lock.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s