How to Compress RMAN Backup in Oracle

In this post we will discuss about Compress RMAN Backup which will help to compress our database backup. There are different rman backup compression levels with Oracle. BASIC, LOW, MEDIUM and HIGH are the four different compression levels. We must have ‘Advanced Compression’ option license to use LOW, MEDIUM and HIGH levels in oracle. 


When we are using COMPRESSED BACKUPSET option while using RMAN BACKUP command that allows RMAN to perform binary compression and they are automatically decompressed during recovery.

To check current compression option:-

Once we will execute the command as show compression algorithm, then here we will see the current value of compression algorithm.

RMAN> SHOW COMPRESSION ALGORITHM ;

Using target database control file instead of recovery catalog RMAN configuration parameters for database with db_unique_name PRD are:

CONFIGURE COMPRESSION ALGORITHM ‘BASIC’ AS OF RELEASE ‘DEFAULT’ OPTIMIZE FOR LOAD TRUE ; # defaultTo configure compression algorithm in your database need to be execute on RMAN prompt. As we know that we have compression algorithm as Low,Medium,High and Basic.

RMAN> CONFIGURE COMPRESSION ALGORITHM ‘LOW’;
RMAN> CONFIGURE COMPRESSION ALGORITHM ‘MEDIUM’;
RMAN> CONFIGURE COMPRESSION ALGORITHM ‘HIGH’;
RMAN> CONFIGURE COMPRESSION ALGORITHM ‘BASIC’; #default

Backup as compressed backupset using RMAN.

RMAN>BACKUP AS compressed backupset DATABASE;
RMAN>BACKUP AS compressed backupset ARCHIVELOG ALL;
RMAN>BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG;
RMAN>BACKUP AS compressed backupset CURRENT CONTROLFILE;
RMAN>BACKUP AS COMPRESSED BACKUPSET DATAFILE 5;

If you are taking incremental backup in your database then you may do the compressed incremental backup as following.

INCREMENTAL LEVEL 0:-

RUN
{
BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 0
DATABASE PLUS ARCHIVELOG;
DELETE NOPROMPT ARCHIVELOG ALL BACKED UP 1 TIMES TO DISK;
}

INCREMENTAL LEVEL 1:-

RUN
{
BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1
DATABASE PLUS ARCHIVELOG;
DELETE NOPROMPT ARCHIVELOG ALL BACKED UP 1 TIMES TO DISK;
}

If you are not using incremental backup then you can simply do the compression as below.

Full Database Backup:-

RUN
{
BACKUP AS COMPRESSED BACKUPSET
DATABASE PLUS ARCHIVELOG;
DELETE NOPROMPT ARCHIVELOG ALL BACKED UP 1 TIMES TO DISK;
}

Apart from compress RMAN Backup post you may check another post related to ‘RMAN Backup‘.

Leave a Comment