oralce查被锁的session并kill掉

--1.查出锁定object的session的信息以及被锁定的object名
SELECT l.session_id sid, s.serial#, l.locked_mode,l.oracle_username,
l.os_user_name,s.machine, s.terminal, o.object_name, s.logon_time
FROM v$locked_object l, all_objects o, v$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid
ORDER BY sid, s.serial# ;

--kill session语句
--alter system kill session 'sid,serial#'
alter system kill session '16,591';

posted @ 2017-01-11 14:08  门罗的魔术师  阅读(222)  评论(2编辑  收藏  举报