1.查询sessionID
select SID,SERIAL# from V$session where SID in (select sid from v$enqueue_lock t where t.type='TO');
2.kill session
select 'alter system kill session '''||a.sid||','||a.SERIAL#||''';' from V$session a where SID in (SELECT SID FROM v$enqueue_lock t WHERE t.type='TO');
执行查询出来的数据,如:
alter system kill session '126,632';