How to estimate RMAN incremental backup size using block change tracking file (Doc ID 1938079.1)

How to estimate RMAN incremental backup size using block change tracking file (Doc ID 1938079.1)

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.1.0.2 and later
Zero Data Loss Recovery Appliance Software - Version 12.1.0.1.0 and later
Information in this document applies to any platform.
***Checked for relevance on 7-Dec-2015***

GOAL

Customer wants to estimate their incremental backup size for disk / tape storage sizing purposes. The block change tracking (BCT) file tracks which database blocks were changed since the last RMAN backup, so that RMAN incremental backups only need to read and write the changed blocks. The change tracking file data can also be used to estimate future incremental backup size.

客户想要估计其增量备份大小,以用于磁盘/磁带存储大小调整。块更改跟踪(BCT)文件跟踪自上次RMAN备份以来更改了哪些数据库块,因此RMAN增量备份仅需要读取和写入更改的块。更改跟踪文件数据还可用于估计将来的增量备份大小。

SOLUTION

Attached are two queries:  随附两个查询

ct_blocks_changed_summary.sql

--ct_blocks_changed_summary.sql

select file#,
       blocks_changed,
       block_size,
       blocks_changed * block_size bytes_changed,
       round(blocks_changed / blocks * 100, 2) percent_changed
from v$datafile join
     (select fno
             file#,
             sum(bct) blocks_changed
      from (select distinct fno, bno, bct from x$krcbit
            where vertime >= (select curr_vertime from x$krcfde
                              where csno=x$krcbit.csno and fno=x$krcbit.fno))
      group by fno order by 1)
using(file#);

ct_blocks_changed_detail.sql

--ct_blocks_changed_detail.sql

alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss';
set pagesize 9999
select vertime, csno, fno, bno, bct from x$krcbit
where vertime >= (select curr_vertime from x$krcfde
                  where csno=x$krcbit.csno and fno=x$krcbit.fno)
order by fno, bno;

The first gives a per-file summary of the number of blocks changed and the second lists all of the individual blocks that changed. The queries show all changes made since the last "bitmap switch". A bitmap switch occurs every time RMAN takes a backup. You can also force a bitmap switch to occur by calling dbms_backup_restore.bctswitch. So if you want to keep statistics for changes per day, week, whatever, then at the end of every interval you would first run the queries and capture the output, then call bctswitch. If you just want to track changes since the last backup, then you don't need to use bctswitch.

第一个列出了每个文件的已更改块数摘要,第二个列出了所有已更改的块。查询显示自上次“位图切换”以来所做的所有更改。每次RMAN进行备份时,都会发生位图切换。您也可以通过调用dbms_backup_restore.bctswitch来强制进行位图切换。因此,如果您想保留每天,每周等等的变化统计信息,那么在每个间隔结束时,您将首先运行查询并捕获输出,然后调用bctswitch。如果您只想跟踪自上次备份以来的更改,则无需使用bctswitch。

Ordinarily each change tracking bit covers 32KB of data (4 blocks if using the default 8KB block size). If you want each bit to only cover one block, set _bct_chunk_size=1 before enabling change tracking. This will give more accurate incremental size results, but BCT file size will also increase. When using change tracking solely as an incremental estimation method, we recommend setting _bct_chunk_size=1.

通常,每个更改跟踪位覆盖32KB数据(如果使用默认的8KB块大小,则为4个块)。如果希望每个位仅覆盖一个块,请在启用更改跟踪之前设置_bct_chunk_size = 1。这将提供更准确的增量大小结果,但BCT文件大小也会增加。当仅将变更跟踪用作增量估算方法时,建议设置_bct_chunk_size = 1。

你可能感兴趣的:(How to estimate RMAN incremental backup size using block change tracking file (Doc ID 1938079.1))