oracledba.help
RMAN

Incremental Merge Backups

Overview

For Oracle Database 10g and later RMAN Incremental Merge Backups (IMB) is the default for backing up your database rather than the traditional method. This method of using RMAN works by creating incrementally updated backups that apply incremental database changes to a corresponding image copy backup. Incremental Merge Backup is is also known as Incrementally Updated Backup in some texts.

This strategy offers the following benefits:

  • Other than the initial image copy creation, all subsequent backups are incremental thus take dramatically less time.
  • Restore operations are significantly faster than traditional RMAN backed up databases.
  • IMB are self maintaining, i.e. they do not require the routine overhead of crosschecks & deletion of obsolete backup pieces.
  • The syntax for RMAN restore and recover operations is the same as the traditional method.
  • You also have the added option where, in case of failure, you only need to execute "switch database to copy" and the database will immediately start to work with the image copy datafiles.

The only downside to using IMB is that it takes up more disk space. You should test IMB for yourself to prove/disprove if this is a real problem for you. IMB is based on the concept that disk technology is getting cheaper, more disks can be used for backup purposes.

If you do not have the disk space use the traditional RMAN backup method. Also, according to Oracle, OS level disk compression cannot be used to implement IMB. If OS level disk compression is enabled database failure and data corruption will occur at some point.

Is IMB right for you?

As Oracle has advanced since introducing IMB most Oracle enterprise environments still seem to choose traditional RMAN backups. IMB should be thoroughly tested to ensure if this method is right for you.

Understanding IMB

Consider the following scenario:

Configure

RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE disk FORMAT 'R:\rman\%%U.bkp';
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP on;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE disk TO
      'R:\rman\%%F';
RMAN> CONFIGURE DEVICE TYPE disk BACKUP TYPE TO compressed backupset;
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'R:\rman\snapshot.ctl';

RMAN> CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK clear;
RMAN> CONFIGURE BACKUP OPTIMIZATION clear;
RMAN> CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK clear;
RMAN> CONFIGURE DEFAULT DEVICE TYPE clear;
RMAN> CONFIGURE MAXSETSIZE clear;
RMAN> CONFIGURE RETENTION POLICY clear;

Backup

RMAN> run {
recover copy of database with tag 'imb';
backup incremental level 1 cumulative  copies=1 for recover of copy
   with tag 'imb' database;
}

1. Initial backup:

  • The RECOVER command actually has no effect, because it cannot find any incremental backups with a tag of imb.
  • However, the BACKUP command will create a new Incremental Level 0 backup that is labeled with a tag of imb because no backups have been created yet with this tag.

2. Second run:

  • The RECOVER command still will have no effect, because it cannot find any Level 1 incremental backups with a tag of imb.
  • The BACKUP command will create its first Incremental Level 1 backup that is labeled with a tag of imb.

3. Third and subsequent backups:

  • The RECOVER command finds the incremental level 1 image copy backups from the previous night's run tagged as imb and applies them to the existing datafile image copies.
  • The BACKUP command will create the next Incremental Level 1 backup that is labeled with a tag of imb.

After the third run RMAN would then choose the following files during a media recovery scenario:

  • The image copy of the database tagged as imb.
  • The most recent incremental level 1 backup.
  • All archived redo logs since the image copy was taken.