GoldenGate, Streams and Distributed Database (MOSC)

MOSC Banner

Simulating Distributed Transaction Failure

Hello experts.

Trying to set up a scenario of record locks due to pending distributed transactions.

Goal: get some rows into DBA_2PC_PENDING for training purposes and forcing commits/rollbacks/purging entries etc.

According to Database Administrator's Guide (12c)

https://docs.oracle.com/database/121/ADMIN/ds_txnman.htm#ADMIN12285

in section 35.9 Simulating Distributed Transaction Failure

the following code should accomplish what I need:

DECLARE
    l_tran_id VARCHAR2(200);
BEGIN
    l_tran_id := dbms_transaction.local_transaction_id(true);
    DBMS_OUTPUT.PUT_LINE('l_tran_id: ' ||l_tran_id);
    abc.package1.proc1@DB2 (  parm1 => 'XXX' );
    COMMIT COMMENT 'ORA-2PC-CRASH-TEST-5';  
END;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center