Image Copy Incremental Updates(ICIU):concepts
㈠ 作用
限制 Redo 的运用量、从而降低恢复时间
㈡ 原理
创建数据文件的镜像拷贝、随后用增量备份集更新镜像拷贝
即:把 1 级增量备份集并入已存在的镜像拷贝中
㈢ 测试
① 脚本
[sql]
RMAN> run {
2> recover copy of database with tag 'ICIU1';
3> backup
4> incremental level 1 tag 'ICIU1'
5> for recover of copy with tag 'ICIU1'
6> database plus archivelog delete input;
7> }
其中、for recover of copy with tag、这告诉 RMAN、所创建的增量备份集将用于镜像拷贝
② 注释
该脚本可以每天运行、每一天运行:
Ⅰ recover copy 命令用前一天的 1 级增量备份更新每个数据文件的镜像拷贝
如果找不到镜像拷贝去更新或者 1 级增量备份去运用
recover copy 命令只是简单地发出一条消息、但不报错
Ⅱ backup 命令创建一个 1 级增量备份集、然而、
如果一个 0 级镜像拷贝不存在、那么、首先、backup 命令会先创建一个 0 级镜像
因此、在任何时候、你有可用于恢复的:
⑴ 最多 48 小时的镜像拷贝
⑵ 最多 24 小时的 1 级增量备份集
⑶ 在线和归档日志去支持完全恢复或者基于时间点的恢复
使用这个策略、去做一次完全恢复、你将不会运用超过 24 小时的归档日志
recover copy 命令会运用所有 1 级增量备份集到带有'ICIU1'标签的镜像拷贝上
注意、2 条命令里的 tag 是必须的
③ 第一次运行【创建 0 级镜像拷贝】
第一次运行 ICIU 脚本:
● recover copy 找不到可更新的镜像拷贝、所以、RMAN 返回了"no copy of datafile 1 found to recover"
● backup 命令意识到这里没有 0 级镜像拷贝(参阅返回消息"no parent backup or copy of datafile 1 found")
因此、RMAN 会为每个数据文件创建一份 0 级镜像拷贝
[sql]
RMAN> run{
2> recover copy of database with tag 'ICIU007';
3> backup
4> incremental level 1 tag 'ICIU007'
5> for recover of copy with tag 'ICIU007'
6> database plus archivelog delete input;
7> }
Starting recover at 06-APR-13
using channel ORA_DISK_1
no copy of datafile 1 found to recover
no copy of datafile 2 found to recover
no copy of datafile 3 found to recover
no copy of datafile 4 found to recover
Finished recover at 06-APR-13
......
......
此处省略 N 个字
......
Starting backup at 06-APR-13
using channel ORA_DISK_1
no parent backup or copy of datafile 1 found
no parent backup or copy of datafile 3 found
no parent backup or copy of datafile 2 found
no parent backup or copy of datafile 4 found
channel ORA_DISK_1: starting datafile copy
input datafile fno=00001 name=/u01/app/oracle/oradata/oracle10/system01.dbf
output filename=/u01/app/oracle/flash_recovery_area/ORACLE10G/datafile/o1_mf_system_8p06t0nt_.dbf tag=ICIU007 recid=3 stamp=812062572
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:46
channel ORA_DISK_1: starting datafile copy
input datafile fno=00003 name=/u01/app/oracle/oradata/oracle10/sysaux01.dbf
output filename=/u01/app/oracle/flash_recovery_area/ORACLE10G/datafile/o1_mf_sysaux_8p06vgsb_.dbf tag=ICIU007 recid=4 stamp=812062601
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:27
channel ORA_DISK_1: starting datafile copy
input datafile fno=00002 name=/u01/app/oracle/oradata/oracle10/undotbs01.dbf
output filename=/u01/app/oracle/flash_recovery_area/ORACLE10G/datafile/o1_mf_undotbs1_8p06wb6c_.dbf tag=ICIU007 recid=5 stamp=812062604
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile fno=00004 name=/u01/app/oracle/oradata/oracle10/users01.dbf
output filename=/u01/app/oracle/flash_recovery_area/ORACLE10G/datafile/o1_mf_users_8p06wffr_.dbf tag=ICIU007 recid=6 stamp=812062605
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
......
......
④ 第二次运行【创建 1 级增量备份集】
第二次运行 ICIU 脚本:
● backup 命令创建 1 级增量备份
● recover copy 命令依然没有起作用、因为、虽然第一次运行时已经创建了 0 级镜像拷贝
但、仍然没有 1 级增量备份
然而、"no copy of datafile 1 found to recover"这消息提示多少有些误导人了
[sql]
RMAN> run{
2> recover copy of database with tag 'ICIU007';
3> backup