Thursday, February 4, 2021

ORA-02049: timeout: distributed transaction waiting for lock

 

This error comes when DML statement waits for a row level lock in remote database and distributed transaction waiting time is timed out, which defaults to 60 seconds specified by init parameter distributed_lock_timeout. In all cases, it involves DB links (distributed transactions)


SQL> update emp@rep1 set deptno=20 where empno=7789;
update emp@rep1 set deptno=20 where empno=7789;
*
ERROR at line 1:
ORA-02049: timeout: distributed transaction waiting for lock
ORA-02063: preceding line from REP1

SQL> show parameter distri
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------
distributed_lock_timeout             integer     60

or
select name,value 
 from v$parameter
where name = 'distributed_lock_timeout';

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------
distributed_lock_timeout             integer     60

Action: : This situation is treated as a deadlock and the statement was rolled back. To set the time-out interval to a longer interval, adjust the initialization parameter DISTRIBUTED_LOCK_TIMEOUT, then shut down and restart the instance.

No comments:

Post a Comment

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...