Oracle Recovery Manager (RMAN) supports several backup types: Full, Incremental Level 0, Level 1 Differential and Level 1 Cumulative. They look similar on the surface, but they behave very differently when RMAN builds a backup chain and, more importantly, when you need to restore.
This guide explains each backup type, the commands to run them, how they affect recovery, and the one-time settings that make any RMAN strategy faster and safer.
/u01/backup/rman, are examples.
Replace them with the backup location used in your environment.
Connect to RMAN
$ rman target /
Recommended One-Time Configuration
Configure these settings once. RMAN stores them in the control file and applies them to every backup.
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK
TO '/u01/backup/rman/AUTO_CTL_%F';
| Setting | Why It Matters |
|---|---|
| Retention policy | Defines which backups are obsolete and can be deleted safely |
| Controlfile autobackup | Takes an extra copy of the control file and SPFILE after every backup and structural change, in the same backup folder |
To review the current configuration at any time:
RMAN> SHOW ALL;
How the Backup Scripts Are Built
Every backup script in this guide is complete and self-contained. Each one writes all of the following to the same folder, so a single directory holds everything needed for a restore:
| Step in the Script | Purpose |
|---|---|
ARCHIVE LOG CURRENT (before) |
Archives the current redo so all redo up to the start of the backup is available |
| Database backup | Full, Level 0 or Level 1 backup of the datafiles |
ARCHIVE LOG CURRENT (after) |
Archives the redo generated during the backup, which is required to make the backup consistent |
| Archived log backup | Backs up every archived log not yet backed up, including those generated during the backup |
| Control file backup | Taken last, so it records every backup piece created by the script |
| SPFILE backup | Needed to start the instance when restoring to a new server |
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT' works in every version
from 11g onwards. From 12c, the SQL '...' wrapper is optional
and ALTER SYSTEM ARCHIVE LOG CURRENT; can be run directly.
Full Backup
A Full backup copies all used blocks of the database. It is a standalone backup and is not part of the incremental backup strategy.
RUN {
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
ALLOCATE CHANNEL c2 DEVICE TYPE DISK;
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP DATABASE
FORMAT '/u01/backup/rman/FULL_%d_%T_%U.bkp'
TAG 'FULL_BACKUP';
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP ARCHIVELOG ALL NOT BACKED UP 1 TIMES
FORMAT '/u01/backup/rman/ARCH_%d_%T_%U.bkp'
TAG 'ARCHIVELOG';
BACKUP CURRENT CONTROLFILE
FORMAT '/u01/backup/rman/CTL_%d_%T_%U.bkp'
TAG 'CONTROLFILE';
BACKUP SPFILE
FORMAT '/u01/backup/rman/SPFILE_%d_%T_%U.bkp'
TAG 'SPFILE';
RELEASE CHANNEL c1;
RELEASE CHANNEL c2;
}
Incremental Level 0 Backup
A Level 0 backup also copies all used blocks, but it is recorded as the baseline for later Level 1 backups. Every incremental strategy starts with a Level 0.
RUN {
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
ALLOCATE CHANNEL c2 DEVICE TYPE DISK;
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP INCREMENTAL LEVEL 0 DATABASE
FORMAT '/u01/backup/rman/L0_%d_%T_%U.bkp'
TAG 'LEVEL_0';
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP ARCHIVELOG ALL NOT BACKED UP 1 TIMES
FORMAT '/u01/backup/rman/ARCH_%d_%T_%U.bkp'
TAG 'ARCHIVELOG';
BACKUP CURRENT CONTROLFILE
FORMAT '/u01/backup/rman/CTL_%d_%T_%U.bkp'
TAG 'CONTROLFILE';
BACKUP SPFILE
FORMAT '/u01/backup/rman/SPFILE_%d_%T_%U.bkp'
TAG 'SPFILE';
RELEASE CHANNEL c1;
RELEASE CHANNEL c2;
}
Full vs Level 0
| Feature | Full Backup | Level 0 Backup |
|---|---|---|
| Command | BACKUP DATABASE |
BACKUP INCREMENTAL LEVEL 0 DATABASE |
| Backs up all used blocks | Yes | Yes |
| Parent for Level 1 backups | No | Yes |
| Typical use | One-off backup before a change, clone or migration | Weekly baseline of an incremental strategy |
Level 1 Differential Backup
A differential Level 1 backs up the blocks changed since the most recent Level 0 or Level 1 backup. It is the default type of Level 1.
RUN {
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
ALLOCATE CHANNEL c2 DEVICE TYPE DISK;
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP INCREMENTAL LEVEL 1 DATABASE
FORMAT '/u01/backup/rman/L1_%d_%T_%U.bkp'
TAG 'LEVEL_1_DIFF';
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP ARCHIVELOG ALL NOT BACKED UP 1 TIMES
FORMAT '/u01/backup/rman/ARCH_%d_%T_%U.bkp'
TAG 'ARCHIVELOG';
BACKUP CURRENT CONTROLFILE
FORMAT '/u01/backup/rman/CTL_%d_%T_%U.bkp'
TAG 'CONTROLFILE';
BACKUP SPFILE
FORMAT '/u01/backup/rman/SPFILE_%d_%T_%U.bkp'
TAG 'SPFILE';
RELEASE CHANNEL c1;
RELEASE CHANNEL c2;
}
Sunday Level 0
Monday L1 Differential → changes since Sunday L0
Tuesday L1 Differential → changes since Monday L1
Wednesday L1 Differential → changes since Tuesday L1
Each backup contains only one day of changes, so daily backups stay small.
Level 1 Cumulative Backup
A cumulative Level 1 backs up all blocks changed since the
most recent Level 0, using the CUMULATIVE
keyword.
RUN {
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
ALLOCATE CHANNEL c2 DEVICE TYPE DISK;
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE
FORMAT '/u01/backup/rman/L1C_%d_%T_%U.bkp'
TAG 'LEVEL_1_CUM';
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP ARCHIVELOG ALL NOT BACKED UP 1 TIMES
FORMAT '/u01/backup/rman/ARCH_%d_%T_%U.bkp'
TAG 'ARCHIVELOG';
BACKUP CURRENT CONTROLFILE
FORMAT '/u01/backup/rman/CTL_%d_%T_%U.bkp'
TAG 'CONTROLFILE';
BACKUP SPFILE
FORMAT '/u01/backup/rman/SPFILE_%d_%T_%U.bkp'
TAG 'SPFILE';
RELEASE CHANNEL c1;
RELEASE CHANNEL c2;
}
Sunday Level 0
Monday L1 Cumulative → changes since Sunday L0
Tuesday L1 Cumulative → changes since Sunday L0
Wednesday L1 Cumulative → changes since Sunday L0
Each backup grows during the week, because it repeats all changes since the Level 0.
What Gets Restored? Differential vs Cumulative
The real difference appears during recovery. Assume the database fails on Wednesday after the Level 1 backup.
Differential strategy:
Restore Sunday L0
Apply Monday L1 + Tuesday L1 + Wednesday L1
Apply Archived logs after Wednesday L1
Cumulative strategy:
Restore Sunday L0
Apply Wednesday L1C only
Apply Archived logs after Wednesday L1C
| Feature | Level 1 Differential | Level 1 Cumulative |
|---|---|---|
| Based on | Most recent Level 0 or Level 1 | Most recent Level 0 |
| Daily backup size | Smaller | Grows through the week |
| Needed for recovery | Level 0 + every Level 1 since + archived logs | Level 0 + latest Level 1 + archived logs |
| Recovery speed | Slower, more pieces to apply | Faster, fewer pieces to apply |
| Risk | One missing Level 1 breaks the chain | Fewer dependencies |
Enable Block Change Tracking
Without Block Change Tracking, a Level 1 backup still reads every block in the database to find the changed ones. The backup is smaller, but not much faster. Block Change Tracking records changed blocks in a small file, so RMAN reads only those blocks.
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING
USING FILE '/u01/app/oracle/bct/PROD_bct.chg';
On ASM, specify the disk group instead:
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '+DATA';
Verify that it is enabled:
SQL> SELECT STATUS, FILENAME FROM V$BLOCK_CHANGE_TRACKING;
Archived Log Backups Between Database Backups
In ARCHIVELOG mode, archived logs are what allow recovery from the last database backup to the point of failure. Every database backup script above already includes them. Between database backups, back up archived logs several times a day to limit data loss and free space in the archive destination. The control file is backed up last so it records the new pieces.
RUN {
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
ALLOCATE CHANNEL c2 DEVICE TYPE DISK;
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP ARCHIVELOG ALL NOT BACKED UP 1 TIMES
FORMAT '/u01/backup/rman/ARCH_%d_%T_%U.bkp'
TAG 'ARCHIVELOG';
BACKUP CURRENT CONTROLFILE
FORMAT '/u01/backup/rman/CTL_%d_%T_%U.bkp'
TAG 'CONTROLFILE';
RELEASE CHANNEL c1;
RELEASE CHANNEL c2;
}
Back Up and Delete Archived Logs
To remove archived logs from the archive destination once they are safely backed up:
RUN {
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
ALLOCATE CHANNEL c2 DEVICE TYPE DISK;
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP ARCHIVELOG ALL NOT BACKED UP 1 TIMES
FORMAT '/u01/backup/rman/ARCH_%d_%T_%U.bkp'
TAG 'ARCHIVELOG'
DELETE INPUT;
BACKUP CURRENT CONTROLFILE
FORMAT '/u01/backup/rman/CTL_%d_%T_%U.bkp'
TAG 'CONTROLFILE';
RELEASE CHANNEL c1;
RELEASE CHANNEL c2;
}
DELETE INPUT can remove archived logs that the standby has not
applied yet. On a Data Guard primary, set a deletion policy first so RMAN
never deletes unapplied logs:
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;
Also note that DELETE INPUT removes logs from one archive
destination only. Use DELETE ALL INPUT to remove them from all
local destinations.
NOARCHIVELOG Mode
In NOARCHIVELOG mode, the backup must be consistent, so the database is shut down cleanly and mounted before the backup.
RMAN> SHUTDOWN IMMEDIATE;
RMAN> STARTUP MOUNT;
RUN {
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
ALLOCATE CHANNEL c2 DEVICE TYPE DISK;
BACKUP INCREMENTAL LEVEL 0 DATABASE
FORMAT '/u01/backup/rman/L0_%d_%T_%U.bkp'
TAG 'LEVEL_0_NOARCH';
BACKUP CURRENT CONTROLFILE
FORMAT '/u01/backup/rman/CTL_%d_%T_%U.bkp'
TAG 'CONTROLFILE';
BACKUP SPFILE
FORMAT '/u01/backup/rman/SPFILE_%d_%T_%U.bkp'
TAG 'SPFILE';
RELEASE CHANNEL c1;
RELEASE CHANNEL c2;
}
RMAN> ALTER DATABASE OPEN;
BACKUP INCREMENTAL LEVEL 0 DATABASE with
BACKUP DATABASE for a Full backup.
Recommended Weekly Strategy
Many production sites combine both Level 1 types: differential backups keep daily backups small, while a mid-week cumulative backup shortens the recovery chain.
| Day | Backup |
|---|---|
| Sunday | Level 0 + archived logs |
| Monday | Level 1 Differential + archived logs |
| Tuesday | Level 1 Differential + archived logs |
| Wednesday | Level 1 Cumulative + archived logs |
| Thursday | Level 1 Differential + archived logs |
| Friday | Level 1 Differential + archived logs |
| Saturday | Level 1 Differential + archived logs |
| Every few hours | Archived logs only |
With this schedule, a failure on Saturday needs at most the Level 0, the Wednesday cumulative and three differential backups.
Housekeeping
Run these regularly to keep the RMAN repository in sync with the files on disk and to remove backups that are no longer needed:
RMAN> CROSSCHECK BACKUP;
RMAN> CROSSCHECK ARCHIVELOG ALL;
RMAN> DELETE NOPROMPT EXPIRED BACKUP;
RMAN> DELETE NOPROMPT OBSOLETE;
EXPIRED means RMAN could not find the backup piece on disk.
OBSOLETE means the backup is no longer needed under the retention
policy.
Verify and Validate Backups
List the backups that exist:
RMAN> LIST BACKUP SUMMARY;
Check which files do not meet the retention policy:
RMAN> REPORT NEED BACKUP;
Most importantly, test that the backups can actually be restored, without restoring anything:
RMAN> RESTORE DATABASE PREVIEW;
RMAN> RESTORE DATABASE VALIDATE;
PREVIEW shows which backup pieces a restore would use.
VALIDATE reads those pieces and checks them for corruption.
Quick Reference
| Backup Type | Command | Contains |
|---|---|---|
| Full | BACKUP DATABASE |
All used blocks, standalone |
| Level 0 | BACKUP INCREMENTAL LEVEL 0 DATABASE |
All used blocks, baseline for Level 1 |
| L1 Differential | BACKUP INCREMENTAL LEVEL 1 DATABASE |
Changes since last Level 0 or Level 1 |
| L1 Cumulative | BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE |
Changes since last Level 0 |
| Archived logs | BACKUP ARCHIVELOG ALL |
Redo needed to recover to any point in time |
Summary
A Full backup and a Level 0 backup contain the same blocks, but only Level 0 can be the parent of incremental backups. Differential Level 1 backups keep daily backups small, while cumulative Level 1 backups keep the recovery chain short. In ARCHIVELOG mode, archived log backups are what turn those backups into point-in-time recovery.
Back up the database, archived logs, control file and SPFILE together in one folder, enable controlfile autobackup and Block Change Tracking, set a retention policy, protect standby archives with a deletion policy, and validate your backups regularly. The right backup strategy is the one that meets your recovery time, not the one with the smallest backup size.