Site icon IT Tutorial

Incremental and Cumulative Backup via RMAN | Oracle RMAN ( Recovery Manager ) Backup Tutorials -5

Hi,

I will continue to tell you about the RMAN (Recovery Manager) tool in this fifth article of my tutorial series .

 

 

Read Older articles of my rman backup tutorial series before this article with following links.

https://ittutorial.org/2019/03/25/oracle-rman-recovery-manager-backup-tutorials-1/

https://ittutorial.org/2019/03/25/oracle-rman-recovery-manager-backup-tutorials-2/

https://ittutorial.org/2019/03/25/oracle-rman-recovery-manager-backup-tutorials-3/

https://ittutorial.org/2019/03/26/oracle-rman-recovery-manager-backup-tutorials-4/

 

 

 

Incremental Backup: This type of backup refers to the Backup of the changed Block after the last full backup. Second incremental backups after the first incremental backup will take the backup of the changed blocks after the previous first incremental backup. In order to take a incremental backup, you must have a full backup associated with this backup. RMAN has two level option for incremental backup. When the level = 0, the full backup of the database is taken, and when level = 1, the backups are taken after first level = 0 backup of the changed blocks.

Here is a sample incremental backup scenario. A full backup is taken on the weekend, and after that the incremental backups are taken every day on the weekday. The incremental backup is the backup of the changed blocks and the first incremental backup is the backup of the blocks after the full backup.

Second incremental backup is changed blocks of the first incremental backup. When the database crashed on wednesday, firstly full backup is restored which is taken on the sunday and than each incremental backups are restored which is taken every day.

A sample Incremental backup script is as follows. You should execute following level 0 backup on sunday.

RMAN> backup incremental level=0 database format '/u01/backup/Level0backup%d_%t_%s.bck';

Starting backup at 25-MAR-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oradata/19c/DEVECI19C/system01.dbf
input datafile file number=00003 name=/oradata/19c/DEVECI19C/sysaux01.dbf
input datafile file number=00004 name=/oradata/19c/DEVECI19C/undotbs01.dbf
input datafile file number=00007 name=/oradata/19c/DEVECI19C/users01.dbf
channel ORA_DISK_1: starting piece 1 at 25-MAR-19
channel ORA_DISK_1: finished piece 1 at 25-MAR-19
piece handle=/u01/backup/Level0backupDEVECI19_1003870501_21.bck tag=TAG20190325T205501 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 25-MAR-19

Starting Control File and SPFILE Autobackup at 25-MAR-19
piece handle=/u01/backup/ControlFilec-4027228950-20190325-0a.rman comment=NONE
Finished Control File and SPFILE Autobackup at 25-MAR-19

 

You should execute following level 1 backup on everyday.

RMAN> backup incremental level=1 database format '/u01/backup/Level1backup%d_%t_%s.bck';

Starting backup at 25-MAR-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oradata/19c/DEVECI19C/system01.dbf
input datafile file number=00003 name=/oradata/19c/DEVECI19C/sysaux01.dbf
input datafile file number=00004 name=/oradata/19c/DEVECI19C/undotbs01.dbf
input datafile file number=00007 name=/oradata/19c/DEVECI19C/users01.dbf
channel ORA_DISK_1: starting piece 1 at 25-MAR-19
channel ORA_DISK_1: finished piece 1 at 25-MAR-19
piece handle=/u01/backup/Level1backupDEVECI19_1003870758_23.bck tag=TAG20190325T205916 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 25-MAR-19

Starting Control File and SPFILE Autobackup at 25-MAR-19
piece handle=/u01/backup/ControlFilec-4027228950-20190325-0b.rman comment=NONE
Finished Control File and SPFILE Autobackup at 25-MAR-19

RMAN>
In the above mentioned incremental Backup scenario, if the full backup level 0 is lost or corrupted, any other incremental backups will be invalid, so you will not be able to restore database from a full backup. Or if the first incremental backup is lost, the incremental backups are taken in the next days will be invalid, and the full backup is taken on Sunday can be restored.

Cumulative Backup: This type of backup is very similar to the incremental backup. Cumulative backup is also a backup type with the backup of the changed blocks after Full backup is taken and level of this backup is 1 like the incremental backup.

The difference between cumulative backup and incremental backup is that Cumulative Backup keeps backup of all changed blocks after the last full backup. In other words, if there is an incremental backup before an incremental backup, then it takes the backup of the changed blocks from first incremental backup. If there is no incremental backup before it, then it takes the backup of the changed blocks after the last backup.

But each Cumulative backup is a backup of the changed blocks after full backup,  so Cumulative backup is taken changed blocks after full backup even if there is one incremental backup before cumulative backup. We can example with this scenario.

Full Backup is taken on Sunday, and incremental backup is taken every day ( monday, Tuesday, Wednesday ) when a Cumulative Backup is taken on Thursday, this cumulative backup will consist of all changed blocks after first full backup.

Cumulative Backup is taken with the following script.


RMAN> backup incremental level 1 cumulative database format '/u01/backup/Cumulativebackup%d_%t_%s.bck';

Starting backup at 25-MAR-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oradata/19c/DEVECI19C/system01.dbf
input datafile file number=00003 name=/oradata/19c/DEVECI19C/sysaux01.dbf
input datafile file number=00004 name=/oradata/19c/DEVECI19C/undotbs01.dbf
input datafile file number=00007 name=/oradata/19c/DEVECI19C/users01.dbf
channel ORA_DISK_1: starting piece 1 at 25-MAR-19
channel ORA_DISK_1: finished piece 1 at 25-MAR-19
piece handle=/u01/backup/CumulativebackupDEVECI19_1003872535_25.bck tag=TAG20190325T212854 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 25-MAR-19

Starting Control File and SPFILE Autobackup at 25-MAR-19
piece handle=/u01/backup/ControlFilec-4027228950-20190325-0c.rman comment=NONE
Finished Control File and SPFILE Autobackup at 25-MAR-19

RMAN>

 

Do you want to learn Oracle Database for Beginners, then read the following articles.

https://ittutorial.org/oracle-database-19c-tutorials-for-beginners/

Exit mobile version