当前位置: 代码迷 >> Oracle管理 >> 不断锁表,该如何解决
  详细解决方案

不断锁表,该如何解决

热度:173   发布时间:2016-04-24 06:17:35.0
不断锁表

oracle 10g

delete from rpt_dayrationout@report
*
ERROR at line 1:
ORA-02049: timeout: distributed transaction waiting for lock
ORA-02063: preceding line from REPORT


为什么总是锁表呢,杀完了,下次还有






------解决方案--------------------
死鎖了,看看是不是 其他session 有鎖等待
select /*+rule*/
-- a.kaddr, --
(select username from v$session where sid = a.sid) username,
a.sid,
(select serial# from v$session where sid = a.sid) serial#,
-- (select ctime from v$lock where KADDR = a.kaddr) ctime, --
a.type,
a.id1,
a.id2,
a.lmode,
a.request,
a.block,
b.sid blocking_sid
from v$lock a,
( select * from v$lock
where request > 0
and type <> 'MR'
) b
where a.id1 = b.id1(+)
and a.id2 = b.id2(+)
and a.lmode > 0
and a.type <> 'MR'
order by username,a.sid,serial#,a.type

------解决方案--------------------
delete后记得commit这个transaction。
  相关解决方案