Jump to Navigation

246 - RMAN compression feature

When using the RMAN compression feature, you can choose among different compression algorithms.
You can query the view V$RMAN_COMPRESSION_ALGORITHM to view the compression algorithms available to you, as shown here :

SQL> select algorithm_name, algorithm_description, is_default from v$rman_compression_algorithm;

ZLIB  : fast but little worse compression ratio
BZIP2 : good compression ratio but little slower

1. You can change the type on compression.

#rman target / nocatalog

RMAN> show compression algorithm;

RMAN configuration parameters for database with db_unique_name QA are:
CONFIGURE COMPRESSION ALGORITHM 'BZIP2'; # default

CONFIGURE COMPRESSION ALGORITHM 'ZLIB';

RMAN> show compression algorithm;

RMAN configuration parameters for database with db_unique_name QA are:
CONFIGURE COMPRESSION ALGORITHM 'ZLIB';

 

2. Start the rman commands

rman target=/ << EOF
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘/(put backup directory here)/autobackup_control_file%F’;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS;
run {
ALLOCATE CHANNEL D01 TYPE DISK MAXPIECESIZE 2047M;
CROSSCHECK BACKUP;
BACKUP AS COMPRESSED BACKUPSET DATABASE FORMAT ‘/(put backup directory here)/df_t%d_%u_%s_%T’;
sql ‘ALTER SYSTEM ARCHIVE LOG CURRENT’;
BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL FORMAT ‘/(put backup directory here)/al_%d_%u_%s_%T;
BACKUP AS COMPRESSED BACKUPSET CURRENT CONTROLFILE FORMAT ‘/(put backup directory here)/control%d_%u_%s_%T’;
CROSSCHECK BACKUP;
DELETE NOPROMPT OBSOLETE;
DELETE NOPROMPT EXPIRED BACKUP;
RELEASE CHANNEL RMAN_BACK_CH01;
}
EXIT;
EOF

3. Ohters.

* By default, RMAN automatically names control file backups and stores them in the flash recovery area.
  To configure RMAN to write control file backups to the /< dir A> directory :
  ( %F will generate a unique filename)

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/< dir A >/cf%F';

* Ensure that RMAN retains all backups needed to recover the database to any point in time in the last 7 days :

RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;

* Retain three backups of each datafile :

RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 3;

* Delete backups no longer required by the retention policy:

RMAN> DELETE OBSOLETE

 

 

Oracle:


Main menu 2

Story | by Dr. Radut