Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think the better question is: What's the best way to move data from SQL Server to Oracle which deletes from MSSS every successfully delivered row?</p> <p>You do these in a loop to makes sure that when you add to one, you delete from the other.</p> <p>If some unknown random thing happens to error on the insert, you'll avoid removing the source record.</p> <p>That's the gist, right?</p> <p>There are much better ways to handle this kind of data movement then committing after each insert/delete distributed transaction loop.</p> <p>First off a commit in the middle of a loop is just bad. In Oracle it's a good way to cause other sessions to get ORA-01555 errors. So I would avoid that if possible. </p> <p>Second you should absolutely know what are the possible causes for reasonable errors on insert. You violate a column length, a FK, a UK... there's a finite list of what could break on insert. Big hairy bad breaks like Unable to extend tablespace SHOULD cause the system to grind to a halt. No need to trap for that. But application issues like I mentioned are easy to manage for.</p> <p>If I were writing this, I would bulk insert all of the rows using Oracle's <a href="http://www.oracle-base.com/articles/10g/DmlErrorLogging_10gR2.php" rel="nofollow">LOG ERRORS INTO</a> to avoid a full ROLLBACK when only one/few row(s) fail.</p> <p>Now you have a table which contains every failed row and the reason it failed. Now you can on the SQL Server side, delete all the rows NOT IN the list of failed ID's. </p> <p>You've accomplished the same thing but with Set based operations instead of SLOW-BY-SLOW, ooops, I mean row by row.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload