Tuesday, 7 August 2018

Query to find locks information in details | Oracle Database

Query to find detailed information regarding Locks in Oracle Database




Below mentioned query will help you find the information regarding locks that what kind of lock it is, where it has occured, who is the owner of the object, object_id etc. The output is formatted according to PUTTY and CMD.

column oracle_username format a15
column os_user_name format a15
column object_name format a37
column object_type format a37
select a.session_id,a.oracle_username, a.os_user_name, b.owner "OBJECT OWNER", b.object_name,b.object_type,a.locked_mode from (select object_id, SESSION_ID, ORACLE_USERNAME, OS_USER_NAME, LOCKED_MODE from v$locked_object) a,(select object_id, owner, object_name,object_type from dba_objects) b where a.object_id=b.object_id;

No comments:

Post a comment