Is there a inbuilt functionality in oracle for auto commit?
Like if i want to update a million rows ,and i want set auto commit to 1000 rows or 2000 rows,i have to just configure if somewhere.
It will update the million rows in a loop with autocommit after each 1000 or 2000 rows.This functionality is available in sqlloader.I want to know if similar functionality is available in oracle too.
Is there a inbuilt functionality in oracle for auto commit? Like if i want
Share
No. You cannot ask Oracle to incrementally commit the work that a single SQL statement is doing. That would violate the Atomicity part of ACID compliance so it would be a really bad thing for a relational database to allow. Doing so would mean that if the database failed or if the statement failed after processing N rows, you’d have no way of knowing which N rows had been processed. Doing so would mean that other users could see partially complete data causing their reports to be incorrect and their queries to potentially return misleading results.
You can, of course, write your own custom logic that updates rows in batches. That is generally, however, a bad idea. It will take longer, potentially much longer, to run a process that is doing interim commits. It will require writing code to make sure that the procedure is re-entrant (that is, that it can pick up where it left off in the event of a server failure without trying to re-update rows that were already updated and committed or at least not update the data to a different value. It will cause the update to generate more
UNDOandREDOon the server. It will require every process that uses the data to be aware that they could be reading it in the middle of processing anUPDATEstatement. And it increases the risk of an ORA-01555 error. There is generally no need to have interim commits– the downsides are very, very seldom worth it.