How to Make a Self-Contained and Consistent Full Backup Set

  • by
You might mistakenly think the backup sets of full backup taken by RMAN online are always consistent and self-contained. No, they’re not. Actually, they’re usually inconsistent with respect to the database checkpoint SCN among data files (Ref: About Inconsistent RMAN Backups).

Restoring the database solely depends on a backup set of online full backup cannot save your database. That is, if you run RESTORE DATABASE, RMAN still needs archive logs to recover some of data files that were backed up in the early stage.

If you insist to backup only one self-contained and consistent full backup set for some reasons (e.g. to make it portable), I recommend the following backup strategies.
  1. Cold full backup
  2. If your database is not required to open 24-7, you may try cold full backup. First of all, you have to start your database to mount state or open read only after a clean shutdown and then take a full backup. Of course, when the end of backup, alter database to open (if previously mounted).

    Please note that, a clean shutdown should leave the database no undo data. All transactions are all either rolled back or committed before close. The following events cannot be called clean shutdowns:
    • SHUTDOWN ABORT
    • Killing SMON accidentally or purposely.
    • Server blackouts
    They left the database unfinished works to do after startup.

    If your database is in NOARCHIVELOG mode, then you have no choice, you must use this kind of strategy to make a consistent and self-contained backup set. Nevertheless, the cold backup is a clear to understand for customers and easy to implement in backup strategies for DBA.

  3. Hot full backup plus archivelog
  4. Which means, the backup set includes inconsistent data files and several required archive logs to make this backup set self-contained. From a higher view, this is also consistent.
    RMAN> backup database plus archivelog;
    By archiving the logs immediately after the backup, you ensure that you have a full set of archived logs through the time of the backup. In this way, you guarantee that you can perform media recovery after restoring this backup (Ref: Backing Up a Whole Database with RMAN).

    If you greatly depends on incremental level 0, 1 strategies to restore and recover the database, you can do this:
    RMAN> backup incremental level 0 database plus archivelog;
    RMAN> backup incremental level 0 database plus archivelog delete input;
    But please do NOT use this:
    RMAN> backup incremental level 0 database plus archivelog not backed up;
    This statement may ruin our goal of making the backup self-contained in some situations.
I will talk more consistent backup strategies, please refer to my another post below:
Are All Oracle Full Backups Consistent?

Leave a Reply

Your email address will not be published. Required fields are marked *