Search

Join this Blog for direct reference of any post into your inbox. To join just click on "Join this Site" under "Follower" then Login with your Email.*** DECLARATION: I Maintain this Blog for Helping Myself While at Work and Welcome any body Needing Help!!!.*** CAUTION: Using any of the script from this Blog may contain at Own Risk. These scripts May or May not have been Tested.***

Sunday, 14 April 2013

RMAN Compressed Backupset

RMAN compresses the backup set contents before writing them to disk. The good thing is that no extra uncompressing techniques are required during recovery when we use RMAN compression technique.
RMAN having three different types of Compression techniques:
  1. Null Compression
  2. Unused Block Compression
  3. Binary Compression
Null Compression: When backing up datafiles into backup sets, RMAN does not back up the contents of data blocks that have never been allocated. This means RMAN will never backup the blocks that are ever used.
For example: We have a tablespace having one datafile of size 200MB and out of 200MB only 110 MB is used. Then RMAN will backup only 110 MB. 
Unused Block Compression:  RMAN skips the blocks that do not currently contain data or unused block. There is no extra action is required for the DBA to use this feature.
Example: We have a tablespace (HRMS) having one datafile of size 100 MB and out of 100 MB; 43 MB is used by the HRMS objects. Then user dropped PAY_EMPLOYEE_PERSONAL_INFO table of size 18 MB from HRMS tablespace, then with Unused Block Compression technique only 25 MB of the files is backed up where as incase of null compression it backed up 43 MB because Null Compression will consider the blocks that are ever used.
Binary Compression: Binary Compression can be done by specifying "AS COMPRESSED" clause in backup command. This option allows the RMAN to perform binary compression and they are automatically decompressed during recovery. This compression technique can greatly reduce the space required for disk backup storage.
RMAN> backup as compressed backupset database;
There is no special efforts to restore database from the compressed backupsets but to restore from the compressed backpuset you need more time than uncompressed backupsets.
To configure RMAN compression:
RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;
followed by …
RMAN> CONFIGURE COMPRESSION ALGORITHM ‘HIGH’;
or
RMAN> CONFIGURE COMPRESSION ALGORITHM ‘MEDIUM’;
or
RMAN> CONFIGURE COMPRESSION ALGORITHM ‘LOW’;
or
RMAN> CONFIGURE COMPRESSION ALGORITHM ‘BASIC’;
 
Oracle 11g added several compression algorithms to compress data. They can be used for compressing tables, LOBs; compressed data pump exports or even RMAN backups. But for some compression algorithms you need to purchase the “Advanced Compression Option”. The compression levels are BASIC, LOW, MEDIUM and HIGH. The compression ratio generally increases from LOW to HIGH, with a trade-off of potentially consuming more CPU resources.
If we have enabled the Oracle Database 11g Release 2 Advanced Compression Option, then we can choose from the following compression levels:
HIGH - Best suited for backups over slower networks where the limiting factor is network speed
MEDIUM - Recommended for most environments. Good combination of compression ratios and speed
LOW - Least impact on backup throughput and suited for environments where CPU resources are the limiting factor.
SQL> Select * from V$RMAN_COMPRESSION_ALGORITHM;
Note: If you do not have the advanced compression license BASIC compression will produce reasonable compression rates at moderate Load.

0 comments:

Post a Comment