日期:2014-05-16 浏览次数:20496 次
今天又学会一招,查看Oracle数据库中由于会话非正常退出而导致的事务锁:
1.查看锁住的表
SELECT b.owner,b.object_name,a.session_id,a.locked_mode FROM v$locked_object a ,dba_objects b WHERE b.object_id = a.object_id;
SELECT b.username,b.sid,b.serial#,logon_time FROM v$locked_object a,v$session b WHERE a.session_id = b.sid order by b.logon_time;
Alter system kill session ‘sid,serial#’