1.先决条件

DGMGRL>  ENABLE FAST_START FAILOVER;
Error: ORA-: requirements not met for enabling fast-start failover
[oracle@vijay02 ~]$ oerr ora
, , "requirements not met for enabling fast-start failover"
// *Cause: The attempt to enable fast-start failover could not be completed
// because one or more requirements were not met:
// - The Data Guard configuration must be in either MaxAvailability
// or MaxPerformance protection mode.
// - The LogXptMode property for both the primary database and
// the fast-start failover target standby database must be
// set to SYNC if the configuration protection mode is set to
// MaxAvailability mode.
// - The LogXptMode property for both the primary database and
// the fast-start failover target standby database must be
// set to ASYNC if the configuration protection mode is set to
// MaxPerformance mode.
// - The primary database and the fast-start failover target standby
// database must both have flashback enabled.
// - No valid target standby database was specified in the primary
// database FastStartFailoverTarget property prior to the attempt
// to enable fast-start failover, and more than one standby
// database exists in the Data Guard configuration.
// *Action: Retry the command after correcting the issue:
// - Set the Data Guard configuration to either MaxAvailability
// or MaxPerformance protection mode.
// - Ensure that the LogXptMode property for both the primary
// database and the fast-start failover target standby database
// are set to SYNC if the configuration protection mode is set to
// MaxAvailability.
// - Ensure that the LogXptMode property for both the primary
// database and the fast-start failover target standby database
// are set to ASYNC if the configuration protection mode is set to
// MaxPerformance.
// - Ensure that both the primary database and the fast-start failover
// target standby database have flashback enabled.
// - Set the primary database FastStartFailoverTarget property to
// the DB_UNIQUE_NAME value of the desired target standby database
// and the desired target standby database FastStartFailoverTarget
// property to the DB_UNIQUE_NAME value of the primary database.

2.设置参数

  a.设置日志同步传输模式

edit database patest set property logxptmode=sync;
edit database satest set property logxptmode=sync;

  b.设置保护模式(MaxAvailability or MaxPerformance)

edit configuration set protection mode as maxavailability;

  c.设置主库故障的转移对象

edit database patest set property FastStartFailoverTarget='satest';
edit database satest set property FastStartFailoverTarget='patest';

  d.主备库设置闪回

3.启用FAST_START FAILOVER

ENABLE FAST_START FAILOVER;

查看状态

DGMGRL> show configuration;

Configuration - dgc

  Protection Mode: MaxAvailability
Databases:
patest - Primary database
Warning: ORA-: fast-start failover observer not started satest - (*) Physical standby database
Warning: ORA-: fast-start failover observer not started Fast-Start Failover: ENABLED    --已开启 Configuration Status:
WARNING

因为没有开启监听器,所以出现警告。

4.开启监听器(监听器可以设置在独立的服务器上,也可以设置为某个节点上,本问设置在节点备库上)

(如果设置在独立的服务器上,要求服务器设置静态监听,和oracle软件)

DGMGRL> START OBSERVER
Observer started
.......

以上是开启监听器的命令,监听器开启后,界面无法返回。

以下是dgmgrl状态信息

DGMGRL> show configuration;

Configuration - dgc

  Protection Mode: MaxAvailability
Databases:
patest - Primary database
satest - (*) Physical standby database Fast-Start Failover: ENABLED    --已开启,没有警告信息,配置文件状态为SUCCUSS Configuration Status:
SUCCESS

5.模拟自动故障转移

  a.假设主库故障(shutdown abort)

  b监听器提示

DGMGRL> START OBSERVER
Observer started ::16.05 Wednesday, December ,
Initiating Fast-Start Failover to database "satest"...
Performing failover NOW, please wait...
Failover succeeded, new primary is "satest"
::19.50 Wednesday, December ,

  以上提示,已自动启用备库为主库

  c.dgmgrl状态信息

DGMGRL> show configuration;

Configuration - dgc

  Protection Mode: MaxAvailability
Databases:
satest - Primary database
Warning: ORA-: unsynchronized fast-start failover configuration patest - (*) Physical standby database (disabled)
ORA-: the standby database needs to be reinstated Fast-Start Failover: ENABLED Configuration Status:
WARNING

  d.尝试修复故障库,把故障库启动到mount状态

  e.监听器自动开始修复故障库

DGMGRL> START OBSERVER
Observer started ::16.05 Wednesday, December ,
Initiating Fast-Start Failover to database "satest"...
Performing failover NOW, please wait...
Failover succeeded, new primary is "satest"
::19.50 Wednesday, December , ::02.03 Wednesday, December ,
Initiating reinstatement for database "patest"...
Reinstating database "patest", please wait...
Operation requires shutdown of instance "atest" on database "patest"
Shutting down instance "atest"...
Unable to connect to database
ORA-: Connect failed because target host or object does not exist Failed.
Warning: You are no longer connected to ORACLE. Please complete the following steps and reissue the REINSTATE command:
shut down instance "atest" of database "patest"
start up and mount instance "atest" of database "patest" ::20.82 Wednesday, December ,

  f.根据监听器提示重启故障库至mount

  g.查看dgmgrl状态信息

DGMGRL> show configuration;

Configuration - dgc

  Protection Mode: MaxAvailability
Databases:
satest - Primary database
Warning: ORA-: unsynchronized fast-start failover configuration patest - (*) Physical standby database (disabled)
ORA-: the standby database needs to be reinstated Fast-Start Failover: ENABLED Configuration Status:
WARNING

  h.reinstate故障库

DGMGRL> reinstate database patest;
Reinstating database "patest", please wait...
Reinstatement of database "patest" succeeded

  i.查看dgmgrl状态信息

DGMGRL> reinstate database patest;
Reinstating database "patest", please wait...
Reinstatement of database "patest" succeeded
DGMGRL> show configuration; Configuration - dgc Protection Mode: MaxAvailability
Databases:
satest - Primary database
patest - (*) Physical standby database Fast-Start Failover: ENABLED Configuration Status:
SUCCESS

状态已恢复。

6.关闭自动故障转移

DGMGRL> stop observer
Done.
DGMGRL> disable fast_start failover;
Disabled.

查看dgmgrl状态信息

DGMGRL> show configuration;

Configuration - dgc

  Protection Mode: MaxAvailability
Databases:
satest - Primary database
patest - Physical standby database Fast-Start Failover: DISABLED --已禁用 Configuration Status:
SUCCESS

7.小结:

快速故障转移可能会导致数据丢失,慎用!

监听器最好设置在独立的服务器上!

DGbroker快速失败转移的更多相关文章

  1. 集合迭代器快速失败行为及CopyOnWriteArrayList

    以下内容基于jdk1.7.0_79源码: 什么是集合迭代器快速失败行为 以ArrayList为例,在多线程并发情况下,如果有一个线程在修改ArrayList集合的结构(插入.移除...),而另一个线程 ...

  2. Java 集合快速失败异常

    快速失败 在JDK中,查看集合有很多关于快速失败的描述: 注意,此实现不是同步的.如果多个线程同时访问一个哈希映射,而其中至少一个线程从结构上修改了该映射,则它必须 保持外部同步.(结构上的修改是指添 ...

  3. Java笔记-快速失败and安全失败

    参考资料:http://blog.csdn.net/chenssy/article/details/38151189 快速失败 fail-fast 安全失败 fail-safe java.util包下 ...

  4. arrayList里的快速失败

    快速失败是指某个线程在迭代集合类的时候,不允许其他线程修改该集合类的内容,这样迭代器迭代出来的结果就会不准确. 比如用iterator迭代collection的时候,iterator就是另外起的一个线 ...

  5. (简单易懂)Java的快速失败(fail-fast)与安全失败,源码分析+详细讲解

    之前在程序中遇到快速失败的问题,在网上找解释时发现网上的问题总结都比较片面,故打算自己总结一个,也可以供以后参考. --宇的季节 首先什么是快速失败? 快速失败是为了提示程序员在多线程的情况下不要用线 ...

  6. 快速失败机制--fail-fast

    fail-fast 机制是Java集合(Collection)中的一种错误机制.当多个线程对同一个集合的内容进行操作时,就可能会产生fail-fast(快速失败)事件.例如:当某一个线程A通过iter ...

  7. 快速失败(fail-fast)和安全失败(fail-safe)的区别

    1.fail-fast和fail-safe比较 Iterator的安全失败是基于对底层集合做拷贝,因此,它不受源集合上修改的影响.java.util包下面的所有的集合类都是快速失败的,而java.ut ...

  8. Java SE之快速失败(Fast-Fail)与快速安全(Fast-Safe)的区别[集合与多线程/增强For](彻底详解)

    声明 特点:基于JDK源码进行分析. 研究费时费力,如需转载或摘要,请显著处注明出处,以尊重劳动研究成果:博客园 - https://www.cnblogs.com/johnnyzen/p/10547 ...

  9. 快速失败/报错机制 - fail-fast

    一.快速报错机制(fail-fast) 这是<Java编程思想>中关于快速报错机制的描述 Java容器有一种保护机制,能够防止多个进程同时修改同一个容器的内容.如果在你迭代遍历容器的过程中 ...

随机推荐

  1. 从头认识java-18.2 主要的线程机制(7)join

    这一章节我们来讨论一下join. 1.什么是join? 阻塞当前线程,让.join的线程先做完.然后再继续当前线程 以下是api的解释: A.join,在API中的解释是,阻塞当前线程B,直到A运行完 ...

  2. 【Java面试题】45 什么是java序列化,如何实现java序列化?或者请解释Serializable接口的作用。

    我们有时候将一个java对象变成字节流的形式传出去或者从一个字节流中恢复成一个java对象,例如,要将java对象存储到硬盘或者传送给网络上的其他计算机,这个过程我们可以自己写代码去把一个java对象 ...

  3. xshell-常用指令汇总 linux 常用指令

    suse linux 常用命令  (1)命令ls——列出文件  ls -la 给出当前目录下所有文件的一个长列表,包括以句点开头的“隐藏”文件  ls a* 列出当前目录下以字母a开头的所有文件  l ...

  4. vc 找到一个或多个多重定义的符号

    vc 找到一个或多个多重定义的符号, 这个问题还是不能很好的解决. 最根本的是: 把所有有关定义的部分都放在.cpp文件中,对应的.h文件中只放声明.这样在#include ""的 ...

  5. office2003 下载地址 及密码

    http://www.downxia.com/downinfo/63.html microsoft office 2003 密钥 GWH28-DGCMP-P6RC4-6J4MT-3HFDY Micro ...

  6. Unity+高通Vuforia SDK——AR

    一.AR概念: 增强现实(Augmented Reality,简称AR),是在虚拟现实的基础上发展起来的新技术,也被称之为混合现实.是通过计算机系统提供的信息增加用户对现实世界感知的技术,将虚拟的信息 ...

  7. 记录下一个自己不常用的关键字-yield

    yield 这个关键字 一直很少用,也不知道具体用途.按照习惯就查询了下MSDN. 意思大致是这样的:在迭代器块中用于向枚举数对象提供值或发出迭代结束信号 表现形式:1. yield return & ...

  8. 电脑开机提示 NTLDR is missing

    电脑开机,黑屏并提示NTLDR is missing Press Ctrl+Alt+Del to restart,并且反复重启都不行,这是怎么回事呢?首先我们来分析下这段英语的含义:NTLDR是指NT ...

  9. linux环境判断字符串是否为非空

    需求描述: 今天帮同事调整脚本,涉及到判断一个字符串为非空的,在此记录下. 操作过程: 通过-n来判断字符串是否为非空,如果为非空那么就是真 #!/bin/bash Str1='MyTest' if ...

  10. 使用scrapy_redis,实时增量更新东方头条网全站新闻

    存储使用mysql,增量更新东方头条全站新闻的标题 新闻简介 发布时间 新闻的每一页的内容 以及新闻内的所有图片.东方头条网没有反爬虫,新闻除了首页,其余板块的都是请求一个js.抓包就可以看到. 项目 ...