Oracle dg 状态校验
查看主库状态: select open_mode,protection_mode,database_role,switchover_status from v$database; OPEN_MODE PROTECTION_MODE DATABASE_ROLE SWITCHOVER_STATUS -------------------- ----------------------------- ------------------------ ------------------------ READ WRITE MAXIMUM PERFORMANCE PRIMARY TO STANDBY 查看备库状态: select open_mode,protection_mode,database_role,switchover_status from v$database; OPEN_MODE PROTECTION_MODE DATABASE_ROLE SWITCHOVER_STATUS ------------------------- ----------------------------- ------------------------ ------------------------ READ ONLY WITH APPLY MAXIMUM PERFORMANCE PHYSICAL STANDBY NOT ALLOWED 检查主备两边的序号 select max(sequence#) from v$log; 备库执行,查看是否有数据未应用 select name,SEQUENCE#,APPLIED from v$archived_log order by sequence#; select SEQUENCE#,FIRST_TIME,NEXT_TIME ,APPLIED from v$archived_log order by 1;
![](https://img2020.cnblogs.com/blog/1722899/202109/1722899-20210919004035438-1761223185.png)