One of the very important needs for DBA/developer is to delete huge data from a table.
Generally Huge deletes causes rollback segment or data-files related errors.
To overcome this, you may want to use this easy piece of code which deletes the data on regular intervals and commits after every 1000 rows
I have taken a example with table name as GL_BALANCES and I’m deleting the data for 04 period
x number :=0;
cursor b0 is select d.rowid from gl.gl_balances d where period_name like '%-04' ;
for b in b0 loop
delete from gl.gl_balances d2 where b.rowid = d2.rowid;
x := x + 1;
if x = 1000 then
x := 0;