12c DataGuard switchover to 'primary'

简介:

一、环境描述
Oracle 12c
RHEL 7

二、操作
注意:需要在物理standby节点执行切换,因为主节点要重启。

1.查看配置

DGMGRL> show configuration;

Configuration - dg_config

  Protection Mode: MaxAvailability
  Members:
  orcl   - Primary database
    orcldg - Physical standby database 

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 30 seconds ago)

2.验证主库

DGMGRL> validate database orcl;

  Database Role:    Primary database

  Ready for Switchover:  Yes

  Flashback Database Status:
    orcl:  Off

3.验证物理备库

DGMGRL> validate database orcldg;

  Database Role:     Physical standby database
  Primary Database:  orcl

  Ready for Switchover:  Yes
  Ready for Failover:    Yes (Primary Running)

  Flashback Database Status:
    orcl:    Off
    orcldg:  On

  Standby Apply-Related Information:
    Apply State:      Running
    Apply Lag:        13 hours 29 minutes 48 seconds (computed 1 second ago)
    Apply Delay:      0 minutes

4.进行切换

DGMGRL> switchover to orcldg;
Performing switchover NOW, please wait...
New primary database "orcldg" is opening...
Oracle Clusterware is restarting database "orcl" ...
ORA-01017: invalid username/password; logon denied

Warning: You are no longer connected to ORACLE.

        shut down instance "orcl" of database "orcl"
        start up instance "orcl" of database "orcl"

5.切换后确认

DGMGRL> show configuration;

Configuration - dg_config

  Protection Mode: MaxAvailability
  Members:
  orcldg - Primary database
    orcl   - Physical standby database 

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 30 seconds ago)

DGMGRL> 









本文转自 roidba 51CTO博客,原文链接:http://blog.51cto.com/roidba/2045589,如需转载请自行联系原作者

目录
相关文章
|
数据库
Recover standby database after primary resetlogs
一般在主库需要恢复并open resetlogs 方式打开的情况下,备库需要重做来构建主备同步架构,但有些情况其实不必大费周章,只需要备库开启flashback功能,就可以在较短的时间内恢复主备同步进程。
1522 0
|
SQL 监控 数据库
【DG】DG之Switchover和Failover的区别
【DG】DG之Switchover和Failover的区别 Dataguard中的role transition:switchover和fa...
1618 0
|
数据库 Go 测试技术
[20151109]使用dgmgrl管理dataguard(15)
[20151109]使用dgmgrl管理dataguard(15).txt 参考链接: http://blog.itpub.net/267265/viewspace-1142649/ http://blog.
1034 0