ORA 02049: Distributed Transaction Timeout waiting for lock

This error occurs when a session is trying to modify a table’s row in a remote database through a
database link that is already locked by another session.

The sessions transaction fails on a timeout if it’s waiting greater than an allowed time in seconds.

An allowed wait time is ruled through the distributed_lock_parameter.

By default, the time is 60 seconds.

SQL> sho parameter distributed_lock_timeout

NAME                                 TYPE        VALUE

———————————— ———– ——————————

distributed_lock_timeout             integer     60

We can treat this timeout as a deadlock.

We can roll back the transaction and try again.

Error:
ORA 02049 : timeout: distributed transaction waiting for lock

ORA 02063: preceding line from DB LINK

Solution:

We can increase the distributed_lock_time by using the below command,


SQL>  alter system set distributed_lock_timeout=600 scope=spfile;

System altered.

SQL> shutdown immediate

SQL> startup

SQL> show parameter distributed_lock_timeout

NAME                                 TYPE        VALUE

———————————— ———– ——————————


distributed_lock_timeout             integer     600

Recent Posts

Start typing and press Enter to search