1.查询所有被锁的表/存储过程
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
AND o.object_name='表名/存储过程名'
ORDER BY sid, s.serial# ;
2.有可能看到一大串的记录,如何删除呢?
ALTER system KILL session 'sid,serial#';
处理5条以上的记录,复制粘贴一个个替换都要疯,巧用EXCEL公式哈,三四十条数据嗖嗖的