继续开启备库应用,确定恢复完成日志没报错信息后取消日志应用,打开数据库,开启ADG:
alter database recover managed standby database disconnect from session; alter database recover managed standby database cancel; alter database open; alter database recover managed standby database using current logfile disconnect from session;查看DG同步状态:
SQL> SELECT OPEN_MODE, DATABASE_ROLE, SWITCHOVER_STATUS, FORCE_LOGGING, DATAGUARD_BROKER, GUARD_STATUS FROM V$DATABASE; OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS FOR DATAGUAR GUARD_S -------------------- ---------------- -------------------- --- -------- ------- READ ONLY WITH APPLY PHYSICAL STANDBY NOT ALLOWED NO DISABLED NONE SQL> set lines 1000 SQL> select * from v$dataguard_stats; NAME VALUE UNIT TIME_COMPUTED DATUM_TIME -------------------------------- ---------------------------------------------------------------- ------------------------------ ------------------------------ ------------------------------ transport lag +00 00:09:37 day(2) to second(0) interval 03/03/2017 10:03:20 03/03/2017 10:03:13 apply lag +00 00:09:38 day(2) to second(0) interval 03/03/2017 10:03:20 03/03/2017 10:03:13 apply finish time day(2) to second(3) interval 03/03/2017 10:03:20 estimated startup time 40 second 03/03/2017 10:03:20 --可以在Primary RAC上归档当前日志模拟业务切换归档: SQL> SELECT OPEN_MODE, DATABASE_ROLE, SWITCHOVER_STATUS, FORCE_LOGGING, DATAGUARD_BROKER, GUARD_STATUS FROM V$DATABASE; OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS FOR DATAGUAR GUARD_S -------------------- ---------------- -------------------- --- -------- ------- READ WRITE PRIMARY TO STANDBY NO DISABLED NONE SQL> alter system archive log current; System altered. --再次在Standby RAC上查看DG同步状态: SQL> r 1* select * from v$dataguard_stats NAME VALUE UNIT TIME_COMPUTED DATUM_TIME -------------------------------- ---------------------------------------------------------------- ------------------------------ ------------------------------ ------------------------------ transport lag +00 00:00:00 day(2) to second(0) interval 03/03/2017 10:04:45 03/03/2017 10:04:44 apply lag +00 00:00:00 day(2) to second(0) interval 03/03/2017 10:04:45 03/03/2017 10:04:44 apply finish time day(2) to second(3) interval 03/03/2017 10:04:45 estimated startup time 40 second 03/03/2017 10:04:45至此,已完成RAC Standby库在同环境下的创建。
第八章 检查资源状态