Oracle 12c Dataguard 数据库恢复

http://allthingsoracle.com/rolling-forward-a-physical-standby-database-using-the-recover-command/

当主数据库和备用数据库之间存在相当大的差异时,你不再需要复杂的前滚流程来填补它们之间的差异。
oracle 12c RMAN能够通过网络执行备用恢复以进行增量备份,并且可以将它们应用到物理备用数据库。

假设主库为orcl, 物理备库为orcl2.


在备库执行(orcl2):

DGMGRL> connect target /

DGMGRL> Edit database orcl2 set state=APPLY-OFF;

SQL> shutdown immediate;
SQL> startup mount;


RMAN> connect target /

RMAN> recover database from service orcl noredo using compressed backupset;

恢复数据文件后,备库中的控制文件的SCN#跟数据文件会不一致,要恢复控制文件。

SQL>SHUTDOWN IMMEDIATE;
SQL>STARTUP NOMOUNT;

RMAN> RESTORE STANDBY CONTROLFILE FROM SERVICE orcl;

SQL>ALTER DATABASE MOUNT;

DGMGRL> Edit database orcl2 set state=APPLY-ON;

DGMGRL>Show configuration
报错,提示找不到相应的日志及备用日志
DGMGRL> Edit database orcl2 set state=APPLY-OFF;
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;

alter database add logfile group 1 ('D:APPORACLEORADATAORCLREDO01.LOG') size 50M;
alter database add logfile group 2 ('D:APPORACLEORADATAORCLREDO02.LOG') size 50M;
alter database add logfile group 3 ('D:APPORACLEORADATAORCLREDO03.LOG') size 50M;

alter database drop logfile group 11;
alter database drop logfile group 12;
alter database drop logfile group 13;
alter database drop logfile group 14;
alter database drop logfile group 15;
alter database drop logfile group 16;

alter database add standby logfile group 11 ('D:APPORACLEORADATAORCLStandBy_REDO11.LOG') size 512M;
alter database add standby logfile group 12 ('D:APPORACLEORADATAORCLStandBy_REDO12.LOG') size 512M;
alter database add standby logfile group 13 ('D:APPORACLEORADATAORCLStandBy_REDO13.LOG') size 512M;
alter database add standby logfile group 14 ('D:APPORACLEORADATAORCLStandBy_REDO14.LOG') size 512M;
alter database add standby logfile group 15 ('D:APPORACLEORADATAORCLStandBy_REDO15.LOG') size 512M;
alter database add standby logfile group 16 ('D:APPORACLEORADATAORCLStandBy_REDO16.LOG') size 512M;

DGMGRL> Edit database orcl2 set state=APPLY-ON;

原文地址:https://www.cnblogs.com/krisy/p/4881514.html