RMAN备份中不同版本是否备份空数据块的问题

本文介绍了Oracle RMAN的两种压缩方式:NULL压缩和未使用块压缩,并解释了这两种压缩方式的区别及应用场景。从Oracle 10.2版本开始,RMAN引入了未使用块压缩,进一步提高了备份效率。


RMAN有两种不同的压缩方式 : 
1.  Null Compression
2.  Unused Block Compression

在Oracle9i开始到10.1,RMAN仅仅支持NULL compression, RMAN不会备份从来没有被分配使用的Block但是会备份曾经被使用但是当前没有数据的块 。

从10.2版本开始,Oracle RMAN不再备份目前不包含数据的Block(包括从来没有分配的block以及曾经被使用但当前没有数据的块)这被称为Unused Block Compression 。

-------------------------------------------------------------------------------------------------------------

参考:  Metalink     Doc ID:  563427.1  

A Complete Understanding of RMAN Compression

By default RMAN has two types of compression : 

1.  Null Compression

2.  Unused Block Compression

Till Oracle Version 10.1 only Null compression in done by default but from Oracle Version 10.2 Null and Unused Block Compression is done.   These compressions are done automatically, no special command is required for these compressions.

1. Null Compression : When backing up datafiles into backup sets, RMAN does not back up the contents of data blocks that have never been allocated. (In previous releases, this behavior. was referred to as NULL compression). This means RMAN will never backup the blocks that are ever used.  Till Oracle version 9i RMAN performs Null Compression.

Example : You have a tablespace having one datafile of size 100MB and out of 100MB only 50 MB is used. Then RMAN will backup only 50MB.


2. Unused Block Compression: From Oracle version 10.2 RMAN skips the blocks that do no currently contain data and this is called Unused Block Compression. RMAN now creates more compact backups of datafiles, by skipping datafile blocks that are not currently used to store data. In previous releases, RMAN only supported NULL compression, which skipped space in datafiles that had never been allocated. No extra action is required on the part of the DBA to use this feature.

Example : You have a tablespace having one datafile of size 100MB and out of 100MB, 50MB is used by the user tables. Then user dropped a table beloning to that tablespace which was of 25MB, with the new Unused Block Compression on 25MB of the files is backed up. In this example if null compression is used then it would have backed up 50MB because Null Compression will consider the blocks that are formatted/ever used.


Unused Block Compression is done, if all of the following conditions apply:

+ The COMPATIBLE initialization parameter is set to 10.2

+ There are currently no guaranteed restore points defined for the database

+ The datafile is locally managed

+ The datafile is being backed up to a backup set as part of a full backup or a level 0 incremental backup

+ The backup set is being created on disk.

Skipping unused data blocks where possible enables RMAN to back up datafiles using less space, and can make I/O more efficient.


BINARY COMPRESSION :
Binary Compression can be done by specifying "AS COMPRESSED" clause in backup command, this compression is called as binary compression.

RMAN can apply a binary compression algorithm as it writes data to backup sets. This compression is similar to the compression provided by many tape vendors when backing up data to tape. But we cannot give exact percentage of compression. This binary compression algorithm can greatly reduce the space required for disk backup storage. It is typically 2x to 4x, and greater for text-intensive databases.

The command to take the compressed backup :

RMAN> backup as compressed backupset database;

 

+ There is some CPU overhead associated with compressing backup sets. If the database being backed up is running at or near its maximum load, you may find the overhead from using AS COMPRESSED BACKUPSET unacceptable. In most other circumstances, compressing backupsets saves enough disk space to be worth the CPU overhead.

+ There is no special command to restore database from the compressed backupsets, the restore command will be the same as with uncompressed backups.
+ The restore from the compressed backpuset will take more time than uncompressed backupsets.


--------------------------------------------------------------------------------

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-615802/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/35489/viewspace-615802/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值