DECLARE CURSOR c1 IS select process,sid,serial#, blocking_session from v$session where blocking_session is not null; i NUMBER:= 0; BEGIN FOR e_rec IN c1 LOOP i:= i+1; EXECUTE immediate 'ALTER SYSTEM KILL SESSION ' ||''''|| e_rec.sid ||','|| e_rec.serial# ||''' '; END LOOP; END; /
This kills the BLOCKED sessions, not the blocking session!
ReplyDelete