弑天下
-- 1. 查看被锁的表SELECT p.spid, a.serial#, c.object_name, b.session_id, b.oracle_username,b.os_user_nameFROM v$process p, v$session a, v$locked_object b, all_objects cWHERE p.addr = a.paddrAND a.process = b.processAND c.object_id = b.object_id-- 2. 查看是哪个进程锁的SELECT sid, serial#, username, status, osuser FROM v$session where serial# = '11016'-- 3. 杀掉这个进程alter system kill session '72,11016';-- 4.批量解锁declare cursor mycur isselect b.sid,b.serial#from v$locked_object a,v$session bwhere a.session_id = b.sid group by b.sid,b.serial#;beginfor cur in mycurloopexecute immediate ( 'alter system kill session '''||cur.sid || ','|| cur.SERIAL# ||''' ');end loop;end;