I have a table containing about 2 million rows. I need to delete about a million of them based on simple criteria, say column x = 1. But I am worry about Oracle's RBS may grow so big that it can't handle it. What is the best way to delete rows in this case? If I have to allocate a big RBS for this purpose, how do I tell it to keep before-image of the deletion in this particular RBS? Or there is a better way to achieve this?
create a new table,
insert as select into the new table from the old,
backup the original table,
drop the original table
rename the new table to the old table,
rebuild indexes grants etc on the new table
rbs is the least of your concerns , mass deletes
can be a serious performance hit as such an action
does no reset the highwater mater and subsequent
scans will scnn up the high water mark even though
those blocks may be empty.
you can delete from the table with logging off.
here you do not need to worry about rollback segments.
careful. you won't be able to go back in case any problem.
Originally posted by rajabalachandra you can delete from the table with logging off.
here you do not need to worry about rollback segments.
careful. you won't be able to go back in case any problem.
eg.
delete from table1
where x=y nologging;
- raja balachandran
Wrong! Nologging has no effect on rollback generation. Better delete in small bathces if you do not have sufficient rollback space.
Sanjay G.
Oracle Certified Professional 8i, 9i.
"The degree of normality in a database is inversely proportional to that of its DBA"
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
Bookmarks