Oracle RMAN Backup Types


Full Backups
A full backup is different from a whole database backup. A full data file backup is a backup that includes every used data block in the file. RMAN copies all blocks into the backup set or image copy, skipping only those data file blocks that have never been used. For a full image copy, the entire file contents are reproduced exactly. A full backup cannot be part of an incremental backup strategy; it cannot be the parent for a subsequent incremental backup.


Incremental Backups
An incremental backup is either a level 0 backup, which includes every block in the data files except blocks that have never been used, or a level 1 backup, which includes only those blocks that have been changed since a previous backup was taken. A level 0 incremental backup is physically identical to a full backup. The only difference is that the level 0 backup can be used as the base for a level 1 backup, but a full backup can never be used as the base for a level 1 backup.

Incremental backups are specified using the INCREMENTAL keyword of the BACKUP command. You specify INCREMENTAL LEVEL [0 | 1].

RMAN can create multilevel incremental backups as follows:
        Differential: Is the default type of incremental backup that backs up all blocks changed after the most recent incremental backup at either level 1 or level 0
        Cumulative: Backs up all blocks changed after the most recent backup at level 0

Examples
        To perform an incremental backup at level 0, use the following command:
               RMAN> BACKUP INCREMENTAL LEVEL 0 DATABASE;
        To perform a differential incremental backup, use the following command:
               RMAN> BACKUP INCREMENTAL LEVEL 1 DATABASE;
        To perform a cumulative incremental backup, use the following command:
               RMAN> BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;

RMAN makes full backups by default if neither FULL nor INCREMENTAL is specified. Unused block compression causes never-written blocks to be skipped when backing up data files to backup sets, even for full backups.

A full backup has no effect on subsequent incremental backups, and is not considered part of any incremental backup strategy, although a full image copy backup can be incrementally updated by applying incremental backups with the RECOVER command.

Fast Incremental Backup
The goal of an incremental backup is to back up only those data blocks that have changed since a previous backup. You can use RMAN to create incremental backups of data files, tablespaces, or the whole database. When making an incremental backup, RMAN scans each block of the data files to see which have changed since the last backup. That makes the backup smaller because only changed blocks are backed up. It also makes recovery faster because fewer blocks need to be restored.

You can perform fast incremental backup by enabling block change tracking. Block change tracking writes to a file the physical address of each block that is changed. When it is time to perform the incremental backup, RMAN can look at the block change tracking file, and back up only those blocks referenced there; it does not have to scan every block to see if it has changed since the last backup. This makes the incremental backup faster.

The maintenance of the tracking file is fully automatic and does not require your intervention. The size of the block change tracking file is proportional to the:
        Database size, in bytes
        Number of enabled threads in a RAC environment
        Number of old backups maintained by the block change tracking file
         
The minimum size for the block change tracking file is 10 MB, and any new space is allocated in 10 MB increments. The Oracle database does not record block change information by default.

Enabling Fast Incremental Backup
You enable block change tracking from the Database Control home page. Navigate to Availability > Backup Settings > Policy. You do not need to set the block change tracking file destination if the DB_CREATE_FILE_DEST initialization parameter is set because the file is created as an Oracle Managed File (OMF) file in the DB_CREATE_FILE_DEST location. You can, however, specify the name of the block change tracking file, placing it in any location you choose.
You can also enable or disable this feature by using an ALTER DATABASE command. If the change tracking file is stored in the database area with your database files, then it is deleted when you disable change tracking.
ALTER DATABASE
{ENABLE|DISABLE} BLOCK CHANGE TRACKING
[USING FILE '...']

You can rename the block change tracking file by using the ALTER DATABASE RENAME command. Your database must be in the MOUNT state to rename the tracking file. The ALTER DATABASE RENAME FILE command updates the control file to refer to the new location. You can use the following syntax to change the location of the block change tracking file:
ALTER DATABASE RENAME FILE '...' TO '...';