RMAN快速增量备份与传统增量备份比较

SYS@PROD5> set linesize 300
SYS@PROD5> set pagesize 100
SYS@PROD5> col filename for a50
SYS@PROD5> select * from v$block_change_tracking;

STATUS   FILENAME   BYTES     CON_ID
---------- -------------------------------------------------- ---------- ----------
DISABLED

SYS@PROD5> alter database enable block change tracking using file '/u01/app/oracle/oradata/PROD5/blk_cht.f';

Database altered.

SYS@PROD5> select * from v$block_change_tracking;

STATUS   FILENAME   BYTES     CON_ID
---------- -------------------------------------------------- ---------- ----------
ENABLED    /u01/app/oracle/oradata/PROD5/blk_cht.f 11599872  0

[oracle@host01 ~]$ ps -ef |grep ctwr
oracle     4008      1  0 13:59 ?        00:00:00 ora_ctwr_PROD5
oracle     4045   3235  0 14:00 pts/3    00:00:00 grep ctwr

[oracle@host01 ~]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Sun Sep 18 14:00:46 2016

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: PROD5 (DBID=1606298904)

RMAN> backup incremental level 0 database;

Starting backup at 18-SEP-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=263 device type=DISK
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/PROD5/example01.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/PROD5/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/PROD5/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD5/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/PROD5/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-SEP-16
channel ORA_DISK_1: finished piece 1 at 18-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD5/backupset/2016_09_18/o1_mf_nnnd0_TAG20160918T140203_cxwcgw0o_.bkp tag=TAG20160918T140203 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 18-SEP-16
channel ORA_DISK_1: finished piece 1 at 18-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD5/backupset/2016_09_18/o1_mf_ncsn0_TAG20160918T140203_cxwchzxl_.bkp tag=TAG20160918T140203 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-SEP-16

SYS@PROD5> create table test_1 as select * from dba_objects;

Table created.

SYS@PROD5> insert into test_1 select * from test_1;

91624 rows created.

SYS@PROD5> /

183248 rows created.

SYS@PROD5> commit;

Commit complete.

SYS@PROD5> select count(*) from test_1;

  COUNT(*)
----------
    366496

SYS@PROD5> get 1
  1  select file#,avg(datafile_blocks) bloks,avg(blocks_read) blocks_read,
  2  avg(blocks_read/datafile_blocks)*100 pct_read,avg(blocks) blocks_backed_up
  3  from v$backup_datafile
  4  where used_change_tracking='YES'
  5  and incremental_level=1
  6  group by file#
  7* order by file#;

SYS@PROD5> @1

no rows selected

RMAN> backup incremental level 1 database;

Starting backup at 18-SEP-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/PROD5/example01.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/PROD5/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/PROD5/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD5/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/PROD5/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-SEP-16
channel ORA_DISK_1: finished piece 1 at 18-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD5/backupset/2016_09_18/o1_mf_nnnd1_TAG20160918T141215_cxwd2087_.bkp tag=TAG20160918T141215 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 18-SEP-16
channel ORA_DISK_1: finished piece 1 at 18-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD5/backupset/2016_09_18/o1_mf_ncsn1_TAG20160918T141215_cxwd28ch_.bkp tag=TAG20160918T141215 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-SEP-16

SYS@PROD5> @1

     FILE# BLOKS BLOCKS_READ   PCT_READ BLOCKS_BACKED_UP
---------- ---------- ----------- ---------- ----------------
1     108800     6295 5.78584559 6158
3 89600       71 .079241071   14
4 19200      325 1.69270833  173
5     159200   156096 98.0502513    1
6  640      256  40    1

---关闭块跟踪,采用普通的增量备份

SYS@PROD5> alter database disable block change tracking;

Database altered.

RMAN> backup incremental level 0 database;

Starting backup at 18-SEP-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/PROD5/example01.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/PROD5/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/PROD5/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD5/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/PROD5/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-SEP-16
channel ORA_DISK_1: finished piece 1 at 18-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD5/backupset/2016_09_18/o1_mf_nnnd0_TAG20160918T143519_cxwff76t_.bkp tag=TAG20160918T143519 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 18-SEP-16
channel ORA_DISK_1: finished piece 1 at 18-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD5/backupset/2016_09_18/o1_mf_ncsn0_TAG20160918T143519_cxwfg1b4_.bkp tag=TAG20160918T143519 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-SEP-16

SYS@PROD5> create table test_2 as select * from dba_objects;

Table created.

SYS@PROD5> insert into test_2 select * from test_2;

91624 rows created.

SYS@PROD5> /

183248 rows created.

SYS@PROD5> commit;

Commit complete.

SYS@PROD5> select count(*) from test_2;

  COUNT(*)
----------
    366496

SYS@PROD5> get 2
  1  select file#,avg(datafile_blocks) bloks,avg(blocks_read) blocks_read,
  2  avg(blocks_read/datafile_blocks)*100 pct_read,avg(blocks) blocks_backed_up
  3  from v$backup_datafile
  4  where incremental_level=1
  5  group by file#
  6* order by file#;

RMAN> backup incremental level 1 database;

Starting backup at 18-SEP-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/PROD5/example01.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/PROD5/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/PROD5/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD5/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/PROD5/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-SEP-16
channel ORA_DISK_1: finished piece 1 at 18-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD5/backupset/2016_09_18/o1_mf_nnnd1_TAG20160918T143727_cxwfk7w2_.bkp tag=TAG20160918T143727 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 18-SEP-16
channel ORA_DISK_1: finished piece 1 at 18-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD5/backupset/2016_09_18/o1_mf_ncsn1_TAG20160918T143727_cxwfkqor_.bkp tag=TAG20160918T143727 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-SEP-16

SYS@PROD5> @2

     FILE# BLOKS BLOCKS_READ   PCT_READ BLOCKS_BACKED_UP
---------- ---------- ----------- ---------- ----------------
1     111360  59979.5 52.7805632       6152.5
3 89600  42179.5 47.0753348 13.5
4 19200   9762.5 50.8463542 178.5
5     159200   156096 98.0502513    1
6  640      256  40    1

实验表明:快速增量备份技术将有效提高传统增量备份效率。以位图文件记录了变化数据块,RMAN通过扫描该位图文件,而不是扫描整个数据文件,就可以获取变化数据块,因此能大幅度提高增量备份效率。



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

转载于:http://blog.itpub.net/30192548/viewspace-2125096/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值