求救 很急 在线等待 Oracle 错误ora-02049怎么解决

发布网友 发布时间:2022-04-19 20:39

我来回答

5个回答

热心网友 时间:2022-04-10 04:45

有锁了,查出锁,然后kill掉就可以了。
查锁语句:
select nvl(S.USERNAME,'Internal') username,
nvl(S.TERMINAL,'None') terminal,
L.SID||','||S.SERIAL# Kill,
U1.NAME||'.'||substr(T1.NAME,1,20) tab,
decode(L.LMODE,1,'No Lock',
2,'Row Share',
3,'Row Exclusive',
4,'Share',
5,'Share Row Exclusive',
6,'Exclusive',null) lmode,
decode(L.REQUEST,1,'No Lock',
2,'Row Share',
3,'Row Exclusive',
4,'Share',
5,'Share Row Exclusive',
6,'Exclusive',null) request
from V$LOCK L,
V$SESSION S,
SYS.USER$ U1,
SYS.OBJ$ T1
where L.SID = S.SID
and T1.OBJ# = decode(L.ID2,0,L.ID1,L.ID2)
and U1.USER# = T1.OWNER#
and S.TYPE != 'BACKGROUND'
order by 1,2,5

kill语句:
alter system kill session ‘sid,serial#’;

热心网友 时间:2022-04-10 06:03

Error: ORA 2049
Text: timeout: distributed transaction waiting for lock
-------------------------------------------------------------------------------
Cause: Exceeded Parameter:DISTRIBUTED_LOCK_TIMEOUT seconds waiting for lock.
Action: treat as a deadlock

*** Important: The notes below are for experienced users - See Note:22080.1

Explanation:
Ignore the "Action" above - this is non-sense.

Basically ORA 2049 is signalled if:

a) you are waiting on another sessions TX enqueue
(Eg: usually you are waiting for a row lock)

AND b) you are performing a distributed operation.
Eg: You are using a DB link for something, even if it is only a
select

AND c) You wait for longer than 'distributed_lock_timeout'

The use of a DB Link opens you up to distributed rules of operation
even if you only READ from it.

You can either increase the timeout OR handle the ORA 2049 as a 'try again'
exception that is not fatal. This mechanism exists to prevent deadlock
so any handling of 'TRY AGAIN' should include an escape clause to prevent
deadlock.

就是说要么增大 distributed_lock_timeout 这个参数的值。要么取消重试一次

热心网友 时间:2022-04-10 07:37

别急 请把错误信息 及 引起错误的语句一并发上 谢谢

热心网友 时间:2022-04-10 09:29

发了一份文档在你邮箱。

热心网友 时间:2022-04-10 11:37

死锁了吧。。。
声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。
E-MAIL:11247931@qq.com