Find Lock Objects


Script1:

SELECT a.object_name, a.object_type, a.status, b.locked_mode L_M, b.oracle_username USERNAME,  b.session_id SID, b.process PID, 
'ALTER SYSTEM KILL SESSION '''||s.sid||','||s.serial#||''';'  kill_statement FROM DBA_OBJECTS A, V$LOCKED_OBJECT B, v$session s 
WHERE a.object_id = b.object_id AND b.session_id=s.sid; 


Script2:
SELECT lo.oracle_username dbuser,lo.os_user_name os_user--,'ALTER SYSTEM KILL SESSION ''' ||s1.sid||','||s1.serial#||''';' kill_statement 
 FROM DBA_OBJECTS o, V$LOCKED_OBJECT lo, dba_waiters w, v$session s2--, v$session s1  WHERE o.object_id = lo.object_id
 AND lo.session_id = w.holding_session    AND w.waiting_session = s2.sid;

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

%d bloggers like this: