ORACLE 12C ADG 之十 (ADG switchover & failover测试)

#验证swictover(主備皆可)

[oracle@DB197 ~]$ dgmgrl sys/xxxxxx

#將主庫切換到 197上

DGMGRL>switchover to 'MPCDB197'; 

DGMGRL> show configuration;

Configuration - ADGbroker

  Protection Mode: MaxAvailability

  Members:

  MPCDB197 - Primary database

    MPCDB196 - (*) Physical standby database

Fast-Start Failover: ENABLED

Configuration Status:

SUCCESS  (status updated 0 seconds ago)

#將主庫切換到 196上

DGMGRL>switchover to 'MPCDB196'; 

DGMGRL> show configuration;

Configuration - ADGbroker

  Protection Mode: MaxAvailability

  Members:

  MPCDB196 - Primary database

    MPCDB197 - (*) Physical standby database

Fast-Start Failover: ENABLED

Configuration Status:

SUCCESS  (status updated 36 seconds ago)


#验证failover

#故障转移failover(模擬196主機shutdown abort情況)

#備機

[oracle@DB197 ~]$ dgmgrl sys/xxxxxx

#模擬主機196災難,將主庫切換到 197上

DGMGRL> failover to 'MPCDB197'

DGMGRL> show configuration;

Configuration - ADGbroker

  Protection Mode: MaxAvailability

  Members:

  MPCDB197 - Primary database

    Warning: ORA-16824: multiple warnings, including fast-start failover-related warnings, detected for the database

    MPCDB196 - (*) Physical standby database (disabled)

      ORA-16661: the standby database needs to be reinstated

Fast-Start Failover: ENABLED

Configuration Status:

WARNING  (status updated 6 seconds ago)

#主機

[oracle@DB196 ~]$ sqlplus / as sysdba

SQL> startup mount;

#備機

[oracle@DB197 ~]$ dgmgrl sys/xxxxxx

DGMGRL> show configuration;

Configuration - ADGbroker

  Protection Mode: MaxAvailability

  Members:

  MPCDB197 - Primary database

    MPCDB196 - (*) Physical standby database

Fast-Start Failover: ENABLED

Configuration Status:

SUCCESS  (status updated 19 seconds ago)


#故障转移failover(模擬197新主機shutdown abort情況)

#新備機

[oracle@DB196 ~]$ dgmgrl sys/xxxxxx

#模擬新主機197災難,將主庫切換到 196上

DGMGRL> failover to 'MPCDB196'

DGMGRL> show configuration;

#新主機

[oracle@DB197 ~]$ sqlplus / as sysdba

SQL> startup mount;

#新備機

[oracle@DB196 ~]$ dgmgrl sys/xxxxxx

DGMGRL> show configuration;

Configuration - ADGbroker

  Protection Mode: MaxAvailability

  Members:

  MPCDB196 - Primary database

    MPCDB197 - (*) Physical standby database

Fast-Start Failover: ENABLED

Configuration Status:

SUCCESS  (status updated 1 second ago)

你可能感兴趣的:(ORACLE 12C ADG 之十 (ADG switchover & failover测试))