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)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容