【Oracle】RMAN评估空间大小

rman评估空间大小

如何评估rman备份的大小

How to estimate the size of an RMAN database backup (Doc ID 1274720.1)

 

GOAL

How to estimate the RMAN backuppiece size for a database that has never been backed up by RMAN before.

如何评估从未备份过的数据库的rman备份片大小。

 

rman备份的最终大小取决于许多因素:

(1)使用的设备类型(DISK或SBT)决定是否使用 ‘UNUSED BLOCK COMPRESSION’ (未使用的块压缩)

(2)在输入扫描期间发现的脏块的数量(空压缩)

(3)备份压缩

 

注意:本文中的信息只是一个粗略的估计,由于块压缩、undo优化和其它在备份时改变的因素会导致估算改变。

 

 

========================先理解rman压缩=================================

A Complete Understanding of RMAN Compression (Doc ID 563427.1)

rman压缩分三种:

1. Null compression ,空压缩

2. Unused block compression,未使用块压缩

3. Binary compression , 二进制压缩

解释:

1.  Null compression -----data blocks that have never been allocated.

2.  Unused block compression -----datafile blocks that are not currently used to store data.

3.  Binary compression -----specifying "AS COMPRESSED" clause in backup command, this compression is called as binary compression.

 

----truncate或delete后的这种块,是属于2.  Unused block compression这种类型的。

=======================================================================

 

SBT

System Backup to Tape. This term specifies a nondisk backup device type, typically a tape library or tape drive. RMAN supports channels of type disk and SBT.

系统备份到磁带。此术语指非磁盘备份设备类型,通常为磁带库或磁带驱动器。RMAN支持磁盘和SBT类型的通道。

 

所以SBT可以理解就是tape.

而disk和tape的区别就是 ‘UNUSED BLOCK COMPRESSION’,disk是采用的,tape不采用,所以disk占用空间比tape小。

 

 

UNUSED block compression can only be used by DISK backups or Oracle Secure Backup and uses space bitmap indexes in locally managed tablespaces to scan only allocated extents during backup and results in a faster backup (we dont have to scan the whole database) and can significantly reduce the size of the backup as ‘dirty‘ blocks that are not allocated will not be scanned - see Note 563427.1:  A Complete Understanding of RMAN Compression.

---‘UNUSED BLOCK COMPRESSION’只能被在备份时用disk备份或oracle安全备份和用在本地管理表空间的空间位图索引来才只扫描已分配的区,这样会有更快速的备份(不需要扫描全部的数据库),并且会显著减少备份大小,因为未分配的脏块不会被扫描。

 

NULL compression is the process of omitting blocks that have NEVER been touch  - only ‘dirty‘ blocks are included in the backuppiece.

---空压缩是省略从未接触过的块的过程--只有脏块被包含在备份片中

 

Backup compression , if used will further compress the output by a factor of 2- 4 times.

---备份压缩,如果使用则会将输出压缩2到4倍(但是影响恢复速度)。

 

To estimate the backupppiece size of an SBT backup (other than Oracle Secure Backup) you would need to know how many dirty blocks are in the WHOLE database - querying db_free_space will tell you how much free space is unallocated BUT a tape backup will scan the whole database so ‘dirty‘ block in unallocated extents will still be included in the backuppiece. If the database contains a high percentage of ‘dirty‘ blocks then worse case scenario is that the backuppiece size will be the same as the database size.

 

总结 :

所以如果是SBT备份,想要评估备份大小,则不需要知道有多少脏块(脏块也是要备份的);

若是disk备份或Oracle Secure Backup,则需要知道有多少脏块(因为脏块不被扫描也不备份)。

【Oracle】RMAN评估空间大小

上一篇:【Oracle】expdp/impdp导出导入dblink


下一篇:CentOS7下Mysql5.5的rpm安装