测试演练一下12C ADG环境,可能因为某些极端情况,比如主库存储异常,只能切换到备库。然后主库存储修复,重新恢复主备。
详见如下操作;
在新主库上操作
$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.
Connected as SYSDG.
DGMGRL>
DGMGRL> show configuration;
Configuration - dg_config
Protection Mode: MaxPerformance
Members:
orcldg - Primary database
orcl - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 34 seconds ago)
DGMGRL> validate database orcldg;
Database Role: Primary database
Ready for Switchover: Yes
DGMGRL> validate database orcl;
Database Role: Physical standby database
Primary Database: orcldg
Ready for Switchover: Yes
Ready for Failover: Yes (Primary Running)
DGMGRL> failover to orcl;
Performing failover NOW, please wait...
Failover succeeded, new primary is "orcl"
DGMGRL> show configuration;
Configuration - dg_config
Protection Mode: MaxPerformance
Members:
orcl - Primary database
orcldg - Physical standby database (disabled)
ORA-16661: the standby database needs to be reinstated
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 71 seconds ago)
##保证原主库为mount状态
DGMGRL> reinstate database orcldg;
Reinstating database "orcldg", please wait...
Reinstatement of database "orcldg" succeeded
DGMGRL> show configuration;
Configuration - dg_config
Protection Mode: MaxPerformance
Members:
orcl - Primary database
orcldg - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 6 seconds ago)
DGMGRL> validate database orcl;
Database Role: Primary database
Ready for Switchover: Yes
DGMGRL> validate database orcldg;
Database Role: Physical standby database
Primary Database: orcl
Ready for Switchover: Yes
Ready for Failover: Yes (Primary Running)
DGMGRL>