DataGuard开启failover
1、修改保护模式
DGMGRL> edit configuration set protection mode as maxAvailability;
Succeeded.
2、修改日志同步方式
DGMGRL> show database verbose xiaohe 'LogXptMode'
LogXptMode = 'ASYNC'
DGMGRL> show database verbose xiaohedg 'LogXptMode'
LogXptMode = 'ASYNC'
DGMGRL> edit database xiaohe set property LogXptMode = 'SYNC';
Property "logxptmode" updated
DGMGRL> edit database xiaohedg set property LogXptMode = 'SYNC';
Property "logxptmode" updated
DGMGRL>
DGMGRL> show database verbose xiaohe 'LogXptMode'
LogXptMode = 'SYNC'
DGMGRL> show database verbose xiaohedg 'LogXptMode'
LogXptMode = 'SYNC'
3、在dgmgrl中配置主库与standby数据库的FastStartFailoverTarget属性
DGMGRL> show database verbose xiaohe 'FastStartFailoverTarget';
FastStartFailoverTarget = 'xiaohedg'
DGMGRL> show database verbose xiaohedg 'FastStartFailoverTarget';
FastStartFailoverTarget = 'xiaohe'
4、启动observer
5、在另外一个终端查看failover状态
DGMGRL> show fast_start failover
Fast-Start Failover: DISABLED
Threshold: 30 seconds
Target: (none)
Observer: xiaohe_dg1
Lag Limit: 30 seconds
Shutdown Primary: TRUE
Auto-reinstate: TRUE
Configurable Failover Conditions
Health Conditions:
Corrupted Controlfile YES
Corrupted Dictionary YES
Inaccessible Logfile NO
Stuck Archiver NO
Datafile Offline YES
Oracle Error Conditions:
(none)
6、激活failover功能
DGMGRL> enable fast_start failover;
Enabled.
7、模拟故障
SQL> shutdown abort;
ORACLE instance shut down.
DGMGRL> start observer
Observer started
23:56:08.19 Saturday, March 18, 2017
Initiating Fast-Start Failover to database "xiaohe"...
Performing failover NOW, please wait...
Failover succeeded, new primary is "xiaohe"
23:56:11.64 Saturday, March 18, 2017
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SQL> startup
ORACLE instance started.
Total System Global Area 839282688 bytes
Fixed Size 2233000 bytes
Variable Size 494931288 bytes
Database Buffers 339738624 bytes
Redo Buffers 2379776 bytes
Database mounted.
ORA-16649: possible failover to another database prevents this database from
being opened
DGMGRL> start observer
Observer started
23:56:08.19 Saturday, March 18, 2017
Initiating Fast-Start Failover to database "xiaohe"...
Performing failover NOW, please wait...
Failover succeeded, new primary is "xiaohe"
23:56:11.64 Saturday, March 18, 2017
00:05:46.24 Sunday, March 19, 2017
Initiating reinstatement for database "xiaohedg"...
Reinstating database "xiaohedg", please wait...
Operation requires shutdown of instance "xiaohedg" on database "xiaohedg"
Shutting down instance "xiaohedg"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "xiaohedg" on database "xiaohedg"
Starting instance "xiaohedg"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "xiaohedg" ...
Reinstatement of database "xiaohedg" succeeded
00:06:42.78 Sunday, March 19, 2017
DataGuard开启failover的更多相关文章
- DataGuard开启延时应用的测试
DataGuard开启延时应用的测试 实验环境:RHEL 6.5 + Oracle 11.2.0.4 GI.DB + Primary RAC(2 nodes)+ Standby RAC(2 nodes ...
- Oracle Dataguard之failover
Oracle Dataguard中,角色转换包含两类:Switchover和Failover.上文<Oracle Dataguard之switchover>中,我们已经谈过了switcho ...
- 物理dataguard 正常切换 脚色转换,switchover_status 状态改变
正常切换切换前: 主库:SQL> select DATABASE_ROLE from v$database;DATABASE_ROLE----------------PRIMARY SQL> ...
- Redis Sentinel:集群Failover解决方案(转载)
本文转载自:http://shift-alt-ctrl.iteye.com/blog/1884370 文中的配置例子,还有failover过程中触发的订阅事件具有很好的参考价值. Redis sent ...
- Duplicate复制数据库并创建物理StandBy(spfile+不同实例名+不同路径)
过程和Duplicate复制数据库并创建物理StandBy类似,只是不需要重启数据库. 目的:创建standby,不重启源数据库 1设定环境如下: Primary数据库 IP 172.17.22.16 ...
- 基于Dubbo框架构建分布式服务(一)
Dubbo是Alibaba开源的分布式服务框架,我们可以非常容易地通过Dubbo来构建分布式服务,并根据自己实际业务应用场景来选择合适的集群容错模式,这个对于很多应用都是迫切希望的,只需要通过简单的配 ...
- redis 集群热备自动切换sentinel配置实战
---恢复内容开始--- Redis SentinelSentinel(哨兵)是用于监控redis集群中Master状态的工具,其已经被集成在redis2.4+的版本中一.Sentinel作用:1): ...
- redis高可用之REDIS SENTINEL
1. Redis主从配置 1.1. 设置主从复制 Master <= Salve 10.24.6.5:6379 <= 10.24.6.7:6379 1.2. 取消主从复制 1.3. ...
- 基于Dubbo框架构建分布式服务
Dubbo是Alibaba开源的分布式服务框架,我们可以非常容易地通过Dubbo来构建分布式服务,并根据自己实际业务应用场景来选择合适的集群容错模式,这个对于很多应用都是迫切希望的,只需要通过简单的配 ...
随机推荐
- idea快速生成实体类
1.打开idea的视图,选择Database 2.选择对应的数据库[这里是mysql为例] 3.输入自己对应的内容,输入完成可点击Test Connection进行测试,成功SUCCESS 4.点击确 ...
- c语言推箱子 扫雷项目
推箱子 两关的推箱子用到一个三维数组 用到的图片数据如下 https://pan.baidu.com/s/1IDE4GQLo46cxNywDqwxmlQ 密码:jdel 代码如下: #include& ...
- word编辑visio文件
Word文档中插入visio文件并编辑: (1)插入->对象->对象->选择“visio文件”,此种方式可插入visio文件的全部. (2)直接打开visio文件->ctrl+ ...
- MyBatis的parameterType传入参数类型
在mybatis映射接口的配置中,有select,insert,update,delete等元素都提到了parameterType的用法,parameterType为输入参数,在配置的时候,配置相应的 ...
- 根据屏幕分辨率判断当前手机型号(swift4.1)
import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoa ...
- .NET Core 单元测试
应用程序测试的类型很多,包括集成测试,Web 测试,负载测试等.在最底层的是单元测试,此测试可以测试单个软件组件或方法.单元测试一般只测试开发人员的代码,不应该测试基础结构普.问题,如数据库,文件系统 ...
- Linux环境搭建 | 手把手教你配置Linux虚拟机
在上一节 「手把你教你安装Linux虚拟机」 里,我们已经安装好了Linux虚拟机,在这一节里,我们将配置安装好的Linux虚拟机,使其达到可以开发的程度. Ubuntu刚安装完毕之后,还无法进行开发 ...
- CSS 锚点 :target属性 制作选项卡
.pic img:first-of-type{display: block;} .pic img:target{display: block;}
- Scala 系列(八)—— 类和对象
一.初识类和对象 Scala 的类与 Java 的类具有非常多的相似性,示例如下: // 1. 在 scala 中,类不需要用 public 声明,所有的类都具有公共的可见性 class Person ...
- C#数据结构_树
树的定义是递归的,用树来定义树.因此,树(以及二叉 树)的许多算法都使用了递归. 结点(Node):表示树中的数据元素. 结点的度(Degree of Node):结点所拥有的子树的个数. 树的度(D ...