当前位置:Gxlcms > mysql > 逻辑Standby之failover

逻辑Standby之failover

时间:2021-07-01 10:21:17 帮助过:23人阅读

1.检查及处理丢失的文档 ORCLLDG_PRI select max(sequence#) from v$archived_log; MAX(SEQUENCE#) -------------- 9 ORCL_STD select sequence#,applied from dba_logstdby_log; SEQUENCE# APPLIED ---------- -------- 6 YES 7 YES 8 YES 9 CURRENT 若查询

1.检查及处理丢失的文档
ORCLLDG_PRI >select max(sequence#) from v$archived_log;

MAX(SEQUENCE#)
--------------
9
ORCL_STD >select sequence#,applied from dba_logstdby_log;

SEQUENCE# APPLIED
---------- --------
6 YES
7 YES
8 YES
9 CURRENT

若查询结果不同,需要手工复制这些文件到待转换的逻辑Standby端,然后注册(alter database register logical logfile '文件路径')。
2.检查日志应用
SQL> select applied_scn,latest_scn from v$logstdby_progress;

APPLIED_SCN LATEST_SCN
----------- ----------
1165355 1165360

不一致,启动逻辑Standby的SQL应用……

3.激活新的Primary数据库

SQL> select database_role,force_logging from v$database;

DATABASE_ROLE FOR
---------------- ---
LOGICAL STANDBY YES

SQL> alter database activate logical standby database finish apply;

Database altered.

SQL> select database_role,force_logging from v$database;

DATABASE_ROLE FOR
---------------- ---
PRIMARY YES

SQL> select * from scott.test;

ID
----------
1
2
3
5
4
角色转换成功,逻辑Standby已经成功转换为Primary。但是,原来的Data Guard配置就失效了,环境脆弱。

人气教程排行