标签:style blog http io ar sp 数据 on 2014
解决办法:
1)通过sys用户连接pl/sql development查询:
SQL>select t2.username, t2.sid, t2.serial#, t2.logon_time
from v$locked_object t1, v$session t2
where t1.session_id = t2.sid
order by t2.logon_time;
结果如下:
2)根据上面的结果SID执行下面的语句查找具体的锁表语句:
SQL>select sql_text
from v$session a, v$sqltext_with_newlines b
where decode(a.sql_hash_value, 0, prev_hash_value, sql_hash_value) =
b.hash_value
and a.sid = &sid
order by piece;
结果如下:该结果即是产生锁表的语句,因为其忘记提交而产生。
3)记录2)中的语句,并且杀死会话,如果会话有必要,在执行一次即可。
SQL>alter system kill session ‘125,7‘;
标签:style blog http io ar sp 数据 on 2014
原文地址:http://www.cnblogs.com/wcwen1990/p/4112580.html