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,則需要知道有多少髒塊(因爲髒塊不被掃描也不備份)。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章