Using Google Chrome?

Download my
free Chrome Extension, Power Notes Searcher, to make searching for and evaluating SAP notes, much easier.

Recent Posts

Friday, August 05, 2011

Optimal Oracle RMAN Backup Command Options

Print Friendly and PDF

Just a very short post about an optimal Oracle RMAN backup command run block.
Here's what *I* think provides an optimal backup for a generic setup.

-- Check our existing files are available before we do some obsolete deleting.
crosscheck archivelog all;
crosscheck backup;


-- Delete any obsolete files before we start so that we have max space available.
-- I have "REDUNDANCY 1" set so that I retain the previous backup until the next backup is completed successfully (you need double disk/tape space available for this).
delete noprompt obsolete;

-- Do the DB and ARCH log backups but put each datafile into it's own piece file.
-- I prefer this because should I need only a specific datafile restored and I have to go to tape, I only need to get the piece that's relevant and this piece is only the datafile needed, saving tape restore time.
-- For Oracle 9i remove the 'as compressed backupset' option.
backup as compressed backupset database filesperset 1 plus archivelog filesperset 1;

-- Now only delete archive logs that are in two separate backups.  This is critical.
delete noprompt archivelog all backed up 2 times to disk;

-- Delete the previous night's backup from disk (obviously you need the space to be able to store two backups on disk).
delete noprompt obsolete;

-- Finally, always a good idea to keep a list of datafiles and temp files that existed at the time of the backup.
report schema;

Make sure that you always save the RMAN backup logs.
I've found that they can be very useful during a restore scenario.

As a tip, you can also run a daily job to list what backups are required to restore a database using the "RESTORE DATABASE PREVIEW SUMMARY;" command.

No comments: