How can I overwrite expired backups on a disk device to save on space and still keep a rolling x days there?

Neil Pike

March 4, 1999

1 Min Read
ITPro Today logo

A. You can't. Without searching the entire file SQL has no way ofknowing how much space each backup takes. To delete one part it would have toread the current backup file and write out all the un-expired dumps to a newfile and then delete/rename. And only then could it write the new one to theend. All this would take far too long and too much disk space.

The expiry date is JUST there to prevent accidental overwrites and nothingelse.

If you want to keep a rolling number of dumps then write them out withdifferent names each day using the DISK=option of the dump command. Then have aregular task check these dumps and delete old ones.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like