Securing Oracle distributed transactions against network failures -
i synchronizing table in local database data table on database on opposite side of earth using distributed transactions. networks connected through vpn on internet. of time works fine, when connection disrupted during active transaction, lock preventing job running again. cannot kill locking session. trying returns "ora-00031: session marked kill" , not killed before cycle local database.
the sync job basically
cursor trans_cursor select col_a, col_b, col_c remote_mastertable@my_link updated null; begin trans in trans_cursor loop insert local_mastertable (col_a, col_b, col_c) values (trans.col_a, trans.col_b, trans.col_c); insert local_detailstable (col_a, col_d, col_e) select col_a, col_d, col_e remote_detailstable@my_link col_a = trans.col_a; update remote_mastertable@my_link set updated = 1 col_a = trans.col_a; end loop; end;
any ideas make sync operation more tolerant network dropouts appreciated. use oracle standard edition one, no enterprise features available.
tia søren
first off, need roll own replication solution? oracle provides technologies streams designed allow replicate data changes 1 system reliably without depending on database link being available. minimizes amount of code have write , amount of maintenance have perform.
assuming application need configured way, oracle have use two-phase commit protocol ensure distributed transaction happens atomically. sounds transactions being left in in-doubt state. should able see information in-doubt transactions in dba_2pc_pending view. should able manually handle in-doubt transaction.
Comments
Post a Comment