Monday, 13 May 2013

Kill locked SQL Sessions


Step1: 

SELECT c.owner,
  c.object_name,
  c.object_type,
  b.sid,
  b.serial#,
  b.status,
  b.osuser,
  b.machine
FROM v$locked_object a ,
  v$session b,
  dba_objects c
WHERE b.sid     = a.session_id
AND a.object_id = c.object_id;

Step2: Kill the respective session by executing following alter command

ALTER SYSTEM KILL SESSION 'SID,SERIAL#';

No comments:

Post a Comment