重庆思庄Oracle、Redhat认证学习论坛
标题:
备库使用增量备份恢复时存在异常数据文件
[打印本页]
作者:
刘泽宇
时间:
2022-2-19 10:42
标题:
备库使用增量备份恢复时存在异常数据文件
1.首先在主库进行增量备份
SQL> select to_char(to_number(CURRENT_SCN)) from v$database;
TO_CHAR(TO_NUMBER(CURRENT_SCN))
----------------------------------------
14439259555409
RMAN> backup incremental from scn 14439259555409 database format '/backup/incr_backup/ForStandby_%U.bak' tag 'forstandby';
RMAN> backup current controlfile for standby format '/backup/incr_backup/ForStandbyCTRL.bak';
2.拷贝增量备份到备库
3.备库上进行恢复
SQL> shutdown immediate
SQL> startup mount
RMAN> crosscheck archivelog all;
RMAN> delete expired archivelog all;
RMAN> DELETE ARCHIVELOG ALL;
RMAN> catalog start with '/data/backup/incr_backup/';
RMAN> recover database noredo;
结果出现报错:
Starting recover at 18-FEB-22
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/18/2022 12:16:25
RMAN-06094: datafile 27 must be restored
4.对数据文件进行处理
在主库对对应数据文件进行备库并拷贝备份到备库
RMAN> run
2> {set newname for datafile 27 to '/emrdata/oradata/emrdg/MANDALA_EMR07.DBF';
3> restore datafile 27;
4> }
RMAN> report schema;
RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name EMRDG
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
27 0 TEST *** /u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00027
RMAN> switch datafile 27 to copy;
datafile 27 switched to datafile copy "/data/oradata/testdg/test07.DBF"
RMAN> report schema;
RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name EMRDG
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
27 2048 TEST *** /data/oradata/testdg/test07.DBF
5.恢复备库
RMAN> recover database noredo;
能够正常恢复
欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/)
Powered by Discuz! X3.2