|
|
ORA-02049: timeout: distributed transaction waiting for lock
tips
Oracle Tips by Burleson Consulting
November 17, 2011
|
Question: I am getting an intermittent
ORA-02049: timeout: distributed transaction waiting for lock
error? How do I keep the ORA-02049 from happening?
Answer: Are you closing your database links
with dbms_session.close_database_link?
See MOSC note: 1018919.102
and look at adjusting your distributed_lock_timeout value and
distributed_recovery_connection_hold_time.
ORA-02049: time-out: distributed transaction
waiting for lock
Cause: The time to wait on a lock in a distributed transaction has
been exceeded. This time is specified in the initialization parameter
DISTRIBUTED_LOCK_TIMEOUT.
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.
Oracle
connections remains open until you end your local session
or until the number of database links for your session exceeds the value of OPEN_LINKS.
To reduce the network
overhead associated with keeping a database link open, then use this clause to
close the link explicitly if you do not plan to use it again in your
session.
Oracle
MOSC describes an issue with
ORA-02049 in which the error occurs along with ORA-01403 in DBMS_REPCAT.EXECUTE.
Here is an example of ORA-02049 occurring in this context:
ksedmp:
internal or fatal error
ORA-02049: timeout: distributed transaction waiting for lock
ORA-06512: at "SYS.DBMS_DEFER_INTERNAL_SYS", line 193
ORA-02063: preceding 2 lines from DATA_HK_PROD
ORA-01403: no data found
ORA-06512: at "ACTSLAB.COMPANY_TAT$RP", line 168
ORA-01085: preceding errors in deferred rpc
This ORA-02049 happens as you attempt to run
DBMS_REPCAT.EXECUT in a particular job or manually.
To resolve ORA-02049, you would need to
increase the SHARED_POOL_SIZE value in init.ora . If you find
that the shared pool is large enough and the ORA-02049 error continues to
exist, you may also want to try flushing the shared pool with ALTER
SYSTEM FLUSH SHARED_POOL; to free even more space.
This should resolve ORA-02049 in this context because errors logged in
DEFERROR actually use the SYS.DBMS_DEFER_INTERNAL_SYS
package. Because it is big, the SYS.DBMS_DEFER_INTERNAL_SYS
package can't be loaded in a shared pool when there is an error such as
ORA-02049. This being, the package can load if the shared pool is
flushed or the SHARED_POOL_SIZE is increased.
Ihis
Oracle
Forum thread offers further information regarding the ORA-02049 error. Here,
ORA-02049 is said to sometimes be caused by a transaction that waited for a
locked object for so long that it times out.