Oracle 12C dg broker实现swithover后failover,也可以failover后再switchover

特别强调:在使用dg broker在执行failover to xxx需要确认一下 主备库是否开启flashback,如果没有开启,需要执行,否则会报错并且库基本上需要重新手工同步了。

alter database flashback on;  --开启数据库一级的flashback功能

 

[oracle@node1 ~]$ dgmgrl
DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production

Copyright (c) 2000, 2013, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@orcl
Connected as SYSDBA.
DGMGRL> show configuration

Configuration - dg

  Protection Mode: MaxPerformance
  Members:
  orcl  - Primary database
    orcl2 - Physical standby database (disabled)

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 43 seconds ago)

DGMGRL> w;
Unrecognized command "w", try "help"
DGMGRL> enable database orcl2
Enabled.
DGMGRL> show configuration

Configuration - dg

  Protection Mode: MaxPerformance
  Members:
  orcl  - Primary database
    orcl2 - Physical standby database 

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 4 seconds ago)

DGMGRL> failover to orcl2
Performing failover NOW, please wait...
Error: ORA-16600: not connected to target standby database for failover

Failed.
Unable to failover
DGMGRL> exit
[oracle@node1 ~]$ dgmgrl
DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production

Copyright (c) 2000, 2013, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@orcl2
Connected as SYSDBA.
DGMGRL> failover to orcl2
Performing failover NOW, please wait...
Failover succeeded, new primary is "orcl2"
DGMGRL> show configuration

Configuration - dg

  Protection Mode: MaxPerformance
  Members:
  orcl2 - Primary database
    orcl  - Physical standby database (disabled)
      ORA-16661: the standby database needs to be reinstated

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 81 seconds ago)

DGMGRL> connect sys/oracle@orcl
Connected as SYSDBA.
DGMGRL> reinstate database orcl
ORA-16795: the standby database needs to be re-created

Configuration details cannot be determined by DGMGRL
DGMGRL> connect sys/oracle@orcl2
Connected as SYSDBA.
DGMGRL> reinstate database orcl
Reinstating database "orcl", please wait...
Operation requires shut down of instance "orcl" on database "orcl"
Shutting down instance "orcl"...
ORACLE instance shut down.
Operation requires start up of instance "orcl" on database "orcl"
Starting instance "orcl"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "orcl" ...
Reinstatement of database "orcl" succeeded
DGMGRL> show configuration

Configuration - dg

  Protection Mode: MaxPerformance
  Members:
  orcl2 - Primary database
    orcl  - Physical standby database 

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 20 seconds ago)
DGMGRL> switchover to orcl
Performing switchover NOW, please wait...
Operation requires a connection to instance "orcl" on database "orcl"
Connecting to instance "orcl"...
Connected as SYSDBA.
New primary database "orcl" is opening...
Operation requires start up of instance "orcl2" on database "orcl2"
Starting instance "orcl2"...
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "orcl"
DGMGRL> 
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值