Home > Database > Mysql Tutorial > body text

逻辑Standby之failover

WBOY
Release: 2016-06-07 15:54:22
Original
1180 people have browsed it

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配置就失效了,环境脆弱。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!