Oracle 锁表以及解锁
-- kill_exec 列为解锁的语句,copy出来执行即可。
select 'alter system kill session ''' || s.sid || ',' || s.serial# || ''' immediate;' kill_exec, l1.sid sid1, l2.sid sid2, l1.type type1, l1.lmode lmode1, l2.type type2, l2.lmode lmode2, s.event, l1.block, l1.request request1, l2.request request2, l1.ctime ct1, l2.ctime ct2, s.username, s.sql_id, s.machine, s.client_identifier, s.terminal, s.program, s.module from v$lock l1, v$lock l2, v$session s where l1.block = 1 and l2.request > 0 and l1.id1 = l2.id1 and l1.id2 = l2.id2 and l1.sid = s.sid order by ct1 desc, ct2 desc;