ORA-02049: Timeout: Distributed Transaction Processing wait lock simulation, ora-02049 Transaction Processing

Source: Internet
Author: User

ORA-02049: Timeout: Distributed Transaction Processing wait lock simulation, ora-02049 Transaction Processing

I want to simulate this error and see what the problem is.

Create a table on Database B:

Create table TEST
(
A number,
B DATE
);
Insert into test (A, B) values (2, to_date ('16-04-2015 16:38:26 ', 'dd-mm-yyyy hh24: mi: ss '));
Insert into test (A, B) values (1, to_date ('24-03-2015 16:32:36 ', 'dd-mm-yyyy hh24: mi: ss '));
Insert into test (A, B) values (2, to_date ('16-04-2015 16:35:19 ', 'dd-mm-yyyy hh24: mi: ss '));
Insert into test (A, B) values (2, to_date ('16-04-2015 16:35:19 ', 'dd-mm-yyyy hh24: mi: ss '));
Commit;

On database:
Drop database link to_ B;
Create database link to_ B
Connect to B _user identified by B _password
Using '(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.10.15.10) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)';

Execute update on Database B without submitting:
SQL> update test set B = sysdate where A = 2;

On database:
SQL> show parameter distributed_lock_timeout;
NAME TYPE VALUE
------------------------------------------------------
Distributed_lock_timeout integer 60

SQL> update test @ to_ B set B = sysdate where A = 2;
Update test @ to_ B set B = sysdate where A = 2
*
Row 3 has an error:
ORA-02049: Timeout: Distributed Transaction Processing wait lock

ORA-02063: followed by line (from TO_ B)


Timeout is reported after 60 s, that is, the value set by distributed_lock_timeout.


Solution: the transaction on Database B is committed as soon as possible, or the SQL (update or delete or merge) on Database B is too slow and needs to be optimized.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.