之前程序运行的时候,突然发生页面卡死,后台不报错的现象,经过排查是数据库表被锁死,下面的sql是查询被锁的表,以及对应的解锁sql;
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 ‘300,37803‘;
SELECT s.sid, s.serial#, s.username, s.schemaname, s.osuser, s.process, s.machine,
s.terminal, s.logon_time, l.type
FROM v$session s, v$lock l
WHERE s.sid = l.sid
AND s.username IS NOT NULL
ORDER BY sid;
原文地址:http://butcher36.blog.51cto.com/9315484/1951461