ORACLE 12C ADG 之十三 (ADG CDB级闪回(Flashback CDB))

#CDB级闪回(Flashback CDB)

#主庫發佈前創建快照備份(發佈回退使用)

#停快速故障轉移功能

DGMGRL> stop observer

DGMGRL> disable fast_start failover;

#检查

[oracle@DB196 log]$ sqlplus / as sysdba

SQL> select flashback_on from v$database;

            YES

#主库停止日志传到从库

SQL> alter system set log_archive_dest_state_2=defer scope=both;

#创建担保还原点

SQL> CREATE RESTORE POINT guar_restore1 GUARANTEE FLASHBACK DATABASE;

#查询flashback模式

SQL> select flashback_on from v$database;

            YES

# 开始CDB 及PDB变更,成功则删除担保还原点,反之失敗则回退,CDB及PDB都将恢复到快照担保还原点

SQL> shutdown immediate

SQL> startup mount;

SQL> select flashback_on from v$database;

            YES

SQL> FLASHBACK database TO RESTORE POINT guar_restore1; 

SQL> SHUTDOWN IMMEDIATE;

            ORA-01109: database not open

SQL> startup

            Database mounted.

            ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open resetlogs;

#检查主库 数据库恢复到快照备份那刻状态,符合预期

SQL> alter system set log_archive_dest_state_2=enable scope=both;

#检查主备一致后删除还原点

SQL> drop RESTORE POINT guar_restore1;

#啟動快速故障轉移功能

DGMGRL> enable fast_start failover;

DGMGRL> start observer

你可能感兴趣的:(ORACLE 12C ADG 之十三 (ADG CDB级闪回(Flashback CDB)))