首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

不断锁表,该如何解决

2012-01-11 
不断锁表oracle 10gdelete from rpt_dayrationout@report*ERROR at line 1:ORA-02049: timeout: distribut

不断锁表

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。

热点排行