合 rman全量+增量恢复报错ORA-01152: file 1 was not restored from a sufficiently old backup
Tags: Oracle故障处理备份恢复rman增量备份ORA-01152
现象
rman在做完增量恢复操作后,执行“alter database open resetlogs;”,报错:ORA-01152: file 1 was not restored from a sufficiently old backup,如下:
1 2 3 4 5 6 7 8 9 | RMAN> alter database open resetlogs; using target database control file instead of recovery catalog RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of alter db command at 02/16/2022 10:46:26 ORA-01152: file 1 was not restored from a sufficiently old backup ORA-01110: data file 1: '/u01/app/oracle/oradata/LHR11G/system01.dbf' |
恢复场景:首先rman全备,然后过了2天,删除这2天的归档,然后做增量备份,然后在异机直接做recover操作的时候报错了。
原因
由于controlfile里所记录的scn与datafile里的scn不一致。
模拟
IP | 版本 | 数据库名 | 归档 | 角色 |
---|---|---|---|---|
172.17.0.2 | 11.2.0.4 | LHR11G | Y | 源端 |
172.17.0.3 | 11.2.0.4 | LHR11G | Y | 目标端 |
环境准备:
1 2 3 4 5 6 7 | -- 源库 docker run -itd --name lhroratest -h lhroratest \ --privileged=true lhrbest/oracle_11g_ee_lhr_11.2.0.4:2.0 init -- 目标库 docker run -itd --name lhroratest2 -h lhroratest2 \ --privileged=true lhrbest/oracle_11g_ee_lhr_11.2.0.4:2.0 init |