Skip to content
Home » Oracle » Routine Backup Strategies (3/5) - Incremental level 0+1 cumulative Backups

Routine Backup Strategies (3/5) - Incremental level 0+1 cumulative Backups

Routine Backup Strategies (2/5) - Incremental level 0+1 Backups
In Oracle, an incremental level 1 cumulative backup is to back up the changes since the last level 0 backup. Please notice that, the backup terminology of backup in Oracle is different from the industrial convention.

Please refer to the following post for knowing the terminology differences.
How to Distinguish Confusing Terminology on Oracle Backup Strategies

In this strategy, we schedule an incremental level 0 backup on Sunday night, and incremental level 1 cumulative backups on the other week night. It always requires a full backup, a cumulative backup and several logs to recover a database. Here are the scripts we use:

For more clearly demonstrate the strategy, I list the backup mode with the day of week below:
  • Sunday: Incremental level 0 backup, it's a full backup.
  • Monday: Incremental level 1 cumulative backup.
  • Tuesday: Incremental level 1 cumulative backup.
  • Wednesday: Incremental level 1 cumulative backup.
  • Thursday: Incremental level 1 cumulative backup.
  • Friday: Incremental level 1 cumulative backup.
  • Saturday: Incremental level 1 cumulative backup.
Create a new incremental level 1 RMAN script.
[oracle@primary01 rman_scripts]$ vi incremental_1_cumulative.rman
run {
backup
incremental level 1 cumulative
database;
backup
archivelog all not backed up;
}

Modify the shell script. The script is able to execute the right RMAN script according to the weekday.
[oracle@primary01 rman_scripts]$ vi run_rman_daily_backup.sh
#!/bin/bash

. /home/oracle/.bash_profile
WORK_DIR=/home/oracle/rman_scripts

if [ `date +%u` = 7 ] ;
then
        EXEC_FILE=$WORK_DIR/incremental_0_full.rman
else
        EXEC_FILE=$WORK_DIR/incremental_1_cumulative.rman
fi

rman target / @$EXEC_FILE >> $WORK_DIR/backup_log_`date +%Y%m%d`.log

Routine Backup Strategies (4/5) - Balanced Incremental Backups

Leave a Reply

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