本帖最后由 橡皮草帽 于 2019-12-20 18:17 编辑
2.7.3failover恢复 failover这种情形是当主库真正出现异常之后,才会执行的操作,那么我们执行过failover之后,如何重新构建DG,这里我们利用flashback database来重构。 新主库(orcl71)操作: SQL> select to_char(standby_became_primary_scn) from v$database; #查询主库的scn值 TO_CHAR(STANDBY_BECAME_PRIMARY_SCN) ---------------------------------------- 1033380 原主库,现在的备库(orcl70)操作: SQL> startup mount ORACLE instance started.
Total System Global Area 3340451840 bytes Fixed Size 2257840 bytes Variable Size 1862274128 bytes Database Buffers 1459617792 bytes Redo Buffers 16302080 bytes Database mounted. SQL> flashback database to scn 1033380; #闪回数据库到scn值 Flashback complete.
SQL> alter database convert to physical standby; #切换物理备库 Database altered.
SQL> shutdown immediate;#关闭数据库 ORA-01507: database not mounted
ORACLE instance shut down. SQL> startup ORACLE instance started.
Total System Global Area 3340451840 bytes Fixed Size 2257840 bytes Variable Size 1862274128 bytes Database Buffers 1459617792 bytes Redo Buffers 16302080 bytes Database mounted. Database opened. SQL> alter database recover managed standby database using current logfile disconnect from session; #开启实时同步 Database altered. 新主备库验证: DG failover恢复完成,验证方法同上2.6。
|