全部博文(389)
分类: Oracle
2014-02-22 12:08:30
使用RMAN进行incremental update backup
在使用rman进行增量备份的时候,增量备份只适应用于backupset,而不适用于image copy。对于image copy只能进
行level 0的备份,这和正常的全备基本上没有任何区,但是无法进行level 1备份.
RMAN> backup as copy incremental level=0 database;
backup as copy incremental level=0 database;
Starting backup at 13-JAN-14
using channel ORA_DISK_1
....................
在进行level 0备份后,试图以level 1做image copy备份
RMAN> backup as copy incremental level=1 database;
backup as copy incremental level=1 database;
Starting backup at 13-JAN-14
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 01/13/2014 17:11:18
RMAN-06022: invalid level specified for image copy: 1
提示level 1是无效的level.
incremental update backup实现了对image copy的增加备份,而不用每次都去做level 0的备份,
比如在时间t1,做了image copy,在时间t2,又需要做一个image copy,如果没有使用incremental
update backup,那么在时间点t2上又需要备份所有的数据文件,这样无疑增加了开销.
使用incremental update backup,在T1上也是做是做一个image copy,这个备份称为base copy,
和incremental backup的level 0的备份差不多,在时间点t2上只会备份变化的块,然后应用到时间点
t1上的备份上去,这样就在t2的时间点备份的时候不需要备份所有的数据块了.在T3时点上,备份的时候
会应用t2的备份去应到t1的image copy上,这样使image copy保持最新.
RMAN> run
{
allocate channel c1 device type disk;
recover copy of database with tag 'abc';
backup incremental level 1 for recover of copy with tag 'abc' database;
}
Starting recover at 13-JAN-14
using channel ORA_DISK_1
no copy of datafile 1 found to recover
..................
Finished recover at 13-JAN-14
Starting backup at 13-JAN-14
using channel ORA_DISK_1
no parent backup or copy of datafile 3 found
...............
input datafile file number=00003 name=/u01/app/oracle/oradata/c12/sysaux01.dbf
output file name=/u01/app/oracle/fast_recovery_area/C12/datafile/o1_mf_sysaux_9f7d0ob4_.dbf tag=ABC RECID=25 STAMP=836760127
channel c1: datafile copy complete, elapsed time: 00:00:45
第一次备份由于之前没有备份过,所以会拷贝所有数据文件
第二次备份时间已经快多了
RMAN>run
2>{
allocate channel c1 device type disk;
recover copy of database with tag 'abc';
backup incremental level 1 for recover of copy with tag 'abc' database;
}
allocated channel: c1
channel c1: SID=270 device type=DISK
Starting recover at 13-JAN-14
no copy of datafile 1 found to recover
..................................
Finished recover at 13-JAN-14
Starting backup at 13-JAN-14
channel c1: starting incremental level 1 datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/c12/sysaux01.dbf
......................
channel c1: starting piece 1 at 13-JAN-14
....................................
第三次备份时间已经快多了
RMAN>run
2>{
allocate channel c1 device type disk;
recover copy of database with tag 'abc';
backup incremental level 1 for recover of copy with tag 'abc' database;
}
channel c1: piece handle=/u01/app/oracle/fast_recovery_area/C12/backupset/2014_01_13/o1_mf_nnnd1_ABC_9f7d7pb9_.bkp tag=ABC
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:01
channel c1: starting incremental datafile backup set restore
channel c1: specifying datafile copies to recover
recovering datafile copy file number=00011 name=/u01/app/oracle/fast_recovery_area/C12/E05591FB63F71786E0430100007F544E/datafile/o1_mf_system_9f7d5vgh_.dbf
recovering datafile copy file number=00012 name=/u01/app/oracle/fast_recovery_area/C12/E05591FB63F71786E0430100007F544E/datafile/o1_mf_sysaux_9f7d3z0x_.dbf
recovering datafile copy file number=00013 name=/u01/app/oracle/fast_recovery_area/C12/E05591FB63F71786E0430100007F544E/datafile/o1_mf_users_9f7d75xg_.dbf
channel c1: reading from backup piece /u01/app/oracle/fast_recovery_area/C12/E05591FB63F71786E0430100007F544E/backupset/2014_01_13/o1_mf_nnnd1_ABC_9f7d9qmy_.bkp
channel c1: piece handle=/u01/app/oracle/fast_recovery_area/C12/E05591FB63F71786E0430100007F544E/backupset/2014_01_13/o1_mf_nnnd1_ABC_9f7d9qmy_.bkp tag=ABC
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:01
Finished recover at 13-JAN-14
可以看到对备份的image copy有恢复操作.