I am enhancing a java based ETL software. One of the issues with this tool in Oralce installations is that when massive deletes happen during ETL, even though I use a smaller batch size with intermediate commits, the batch runs out of UNDO space. In my current production scenario, there exists a hard limit of 4GB.
So, now, say, my program tries delete 10000 records from a parent table, committing after every 1000 records and each record deletion, cascade deletes 1 million records from 5 child tables, I’ve 1000x5x1000,000 deletes happening per batch/commit. I want my software to be smarter than this – I want it to figure out Oracle UNDO space, estimate how many deletes would be triggered and limit batch size accordingly. How do I do this? How do I figure UNDO related information using a query?
4GB is nothing. The correct approach is to increase the UNDO space.
Mind you, massive deletes are also to be discouraged, and it’s well worth looking into ways of eliminating that.