ORA-02049: Timeout: Distributed Transaction Processing waiting for Lock diagnostics
In the formal environment, there are two databases A and B. dblink is built on Database A. The business is to update some tables in database A to database B through dblink, always reports an error when updating: ORA-02049: Timeout: Distributed Transaction Processing wait timeout.
Before I wrote A blog: ORA-02049: Timeout: Distributed Transaction Processing wait lock simulation, roughly means that through A to update the data in B, because the data in database B has A lock, if it is not released, an error is returned through update.
The diagnosis is as follows:
Run the command on Database B to find the session that generates the lock.
Select s. owner, s. object_name, l. SID, l. TYPE, l. LMODE, l. REQUEST, l. BLOCK
From gv $ lock l, dba_objects s
Where l. ID1 = s. object_id
And s. object_name = 'test ';.
Find the locked session information, and then use osuser and machine to find the specific application. Stop the application and then perform the test.
Select sid, username, schemaname, osuser, machine, program from gv $ session where sid = 1142;