日期:2014-05-16  浏览次数:20520 次

[每日一题] 11gOCP 1z0-052 :2013-08-30 差异的增量备份.....................................................A1

转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/10669381



正确答案:AD

 

   执行增量备份操作时,首先需要的是增量基本备份(incremental base backup),今后所有的增量备份都是基于这个基本备份的。每次执行数据库的备份操作时,都可以通过backup命令incremental参数来 为备份派一个增量级别标识符。基本备份的增量级别为0,并且必须有基本备份才能够执行其它类型的增量备份操作。如果没有生成基本备份就尝试执行增量备份操作(这个增量备份操作使用0以外的备份级别),RMAN就自动执行基本备份操作。下面是一个执行基本增量备份操作的命令:

  

RMAN> backup incremental level=0 database;

Starting backup at 30-AUG-13
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=00001 name=/u01/app/oracle/oradata/ocm/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/ocm/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/ocm/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/ocm/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/ocm/gyj01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ocm/users01.dbf
channel ORA_DISK_1: starting piece 1 at 30-AUG-13
channel ORA_DISK_1: finished piece 1 at 30-AUG-13
piece handle=/u01/app/oracle/product/11.2.0/dbs/0roikg46_1_1 tag=TAG20130830T214333 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:03:05
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 30-AUG-13
channel ORA_DISK_1: finished piece 1 at 30-AUG-13
piece handle=/u01/app/oracle/product/11.2.0/dbs/0soikga0_1_1 tag=TAG20130830T214333 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 30-AUG-13

  其实增量备份分为差异备份和累积备份,这是两种执行增量备份操作的不同方法。这道题目是讲差异增量备份。

  差异备份是RMAN生成的增量备份的默认类型。对于差异备份来说,RMAN会备份自上一次同级或低级差异增量备份以来所有发生变化的数据块。

  本题是说星期天进行级别为0的差异增量备份操作,这个备份会操作备份整个数据库。根据这个级别为0的备份,我们在星期一到星期六进行级别为1的差异增量备份操作。使用差异备份,每天的备份将包含自一次差异备份以来发生的所有更改。最后,在下一个星期天,进行别一次基本备份(即级别为0的增量备份)。

  如下图所示:

  


  脚本如下:

 

vi increment0.sql
     rman target / <<EOF
     backup incremental level =0 database;
     exit
    EOF

     vi increment1.sql
     rman target / <<EOF
     backup incremental level =1 database;
     exit
     EOF

  星期天到星期六备份计划:

crontab -e

     0 2 * * 0  /home/oracle/increment0.sql > /tmp/increment0.log 2>&1
     0 2 * * 1  /home/oracle/increment1.sql > /tmp/increment1.log 2>&1
     0 2 * * 2  /home/oracle/increment1.sql > /tmp/increment2.log 2>&1
     0 2 * * 3  /home/oracle/increment1.sql > /tmp/increment3.log 2>&1
     0 2 * * 4  /home/oracle/increment1.sql > /tmp/increment4.log 2>&1
     0 2 * * 5  /home/oracle/increment1.sql > /tmp/increment5.log 2>&1
     0 2 * * 6  /home/oracle/increment1.sql > /tmp/increment6.log 2>&1


QQ:252803295

学习交流QQ群:
DSI&Core Search  Ⅰ 群:127149411(技术:已满)
DSI&Core Search  Ⅱ 群:177089463(技术:未满)
DSI&Core Search  Ⅲ 群:284596437(技术:未满)
DSI&Core Search  Ⅳ 群:192136702(技术:未满)
DSI&Core Search  Ⅴ 群:285030382(闲聊:未满)