How to compress full incremental backup L0, L1 backup using rman

Introduction:-

Basically Backup compress full incremental backup is the feature of Oracle Database which offer more benefit. We can take the oracle rman backup as normal or in compress mode. Restoration process of compressed backup will same as uncompressed backup.

Compress Full Incremental backup using RMAN:- 

Incremental backups can be either level 0 or level 1. A level 0 incremental backup, which is the base backup for subsequent incremental backups, copies all blocks containing data, backing the datafile up into a backup set just as a full backup.

The only difference between a level 0 incremental backup and a full backup is that a full backup is never included in an incremental strategy. We will perform backup using rman incremental backup script.

 
 
 

RUN

{

CROSSCHECK ARCHIVELOG ALL;

sql ‘alter system archive log current’;

BACKUP AS compressed backupset filesperset 8 DATABASE FORMAT ‘$destnation/DB_%d_%p_%T_%s.rbkp’ TAG DAILY_HOT_BACKUP;

sql ‘alter system archive log current’;

BACKUP AS compressed backupset ARCHIVELOG ALL NOT BACKED UP 1 TIMES FORMAT ‘$destnation/ARCBAK_%d_%p_%T_%s.rbkp’ TAG ARCHIVE_BKP;

BACKUP AS compressed backupset CURRENT CONTROLFILE FORMAT ‘$destnation/CNT_%d_%p_%T_%s.rbkp’ TAG CONTROL_FILE;

}

 

Backup as compressed backupset incremental level 0

Incremental LEVEL 0 oracle db backup :-

:-

The purpose of an incremental backup is to rman full backup only those data blocks that have changed since a previous backup. We will do the rman backup as compressed backupset full database.

rman script for full database backup.
 
RUN {
 
BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 0
DEVICE TYPE DISK
TAG = ‘DAILY_INC_FULL’ FORMAT ‘/venusBackup/RMAN_HOTBACKUP/PROD_DB/%d_DB_%u_%s_%p’ database;
 
#*** DAILY CONTROLFILE BACKUP
 
BACKUP AS BACKUPSET DEVICE TYPE DISK TAG = ‘DAILY_CONTROLFILE’ FORMAT ‘/venusBackup/RMAN_HOTBACKUP/PROD_DB/%d_CTL_%u_%s_%p’
CURRENT CONTROLFILE;
 
#***** DAILY SPFILE BACKUP
 
BACKUP AS BACKUPSET DEVICE TYPE DISK TAG = ‘DAILY SPFILE’
FORMAT ‘/venusBackup/RMAN_HOTBACKUP/PROD_DB/%d_SPFILE_%u_%s_%p’
SPFILE;
 
#*******ARCHIVELOG BACKUP****
 
sql ‘alter system archive log current’;
BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 0 DEVICE TYPE DISK TAG = ‘DAILY_INCR_CUM_ARCHIVEDLOG’
FORMAT ‘/venusBackup/RMAN_HOTBACKUP/PROD_DB/%d_ARC_%u_%s_%p’
ARCHIVELOG ALL;
 
#*****Remove backuped archivelog before 6 day’s******#
DELETE ARCHIVELOG UNTIL TIME ‘sysdate-6’ BACKED UP 1 TIMES TO DEVICE TYPE DISK;
}
 
 

Backup as compressed backupset incremental level 1:-

 
 

RUN {

BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 DEVICE TYPE DISK TAG = ‘DAILY_INC_L1_BACKUP’ FORMAT ‘/venusBackup/RMAN_HOTBACKUP/PROD_DB/%d_DB_%u_%s_%p’ database;

#*** DAILY CONTROLFILE BACKUP 

BACKUP AS BACKUPSET DEVICE TYPE DISK TAG = ‘DAILY_CONTROLFILE’ FORMAT ‘/venusBackup/RMAN_HOTBACKUP/PROD_DB/%d_CTL_%u_%s_%p’ CURRENT CONTROLFILE;

#***** DAILY SPFILE BACKUP

BACKUP AS BACKUPSET DEVICE TYPE DISK TAG = ‘DAILY SPFILE’ FORMAT ‘/venusBackup/RMAN_HOTBACKUP/PROD_DB/%d_SPFILE_%u_%s_%p’ SPFILE;

#*******ARCHIVELOG BACKUP****

sql ‘alter system archive log current’;

BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 

DEVICE TYPE DISK TAG = ‘DAILY_INCR_L1_ARCHIVEDLOG’ FORMAT ‘/venusBackup/RMAN_HOTBACKUP/PROD_DB/%d_ARC_%u_%s_%p’ ARCHIVELOG ALL;

#*****Remove backuped archivelog before 6 day’s******#

DELETE ARCHIVELOG UNTIL TIME ‘sysdate-6’ BACKED UP 1 TIMES TO DEVICE TYPE DISK;

}

To reduce backup sizes for databases. Instead of making a whole database backup every time, you can make incremental backups as L0 then L1.

Leave a Comment