Skip to content

/AWS1/CL_RDS=>FAILOVERDBCLUSTER()

About FailoverDBCluster

Forces a failover for a DB cluster.

For an Aurora DB cluster, failover for a DB cluster promotes one of the Aurora Replicas (read-only instances) in the DB cluster to be the primary DB instance (the cluster writer).

For a Multi-AZ DB cluster, after RDS terminates the primary DB instance, the internal monitoring system detects that the primary DB instance is unhealthy and promotes a readable standby (read-only instances) in the DB cluster to be the primary DB instance (the cluster writer). Failover times are typically less than 35 seconds.

An Amazon Aurora DB cluster automatically fails over to an Aurora Replica, if one exists, when the primary DB instance fails. A Multi-AZ DB cluster automatically fails over to a readable standby DB instance when the primary DB instance fails.

To simulate a failure of a primary instance for testing, you can force a failover. Because each instance in a DB cluster has its own endpoint address, make sure to clean up and re-establish any existing connections that use those endpoint addresses when the failover is complete.

For more information on Amazon Aurora DB clusters, see What is Amazon Aurora? in the Amazon Aurora User Guide.

For more information on Multi-AZ DB clusters, see Multi-AZ DB cluster deployments in the Amazon RDS User Guide.

Method Signature

IMPORTING

Required arguments:

IV_DBCLUSTERIDENTIFIER TYPE /AWS1/RDSSTRING /AWS1/RDSSTRING

The identifier of the DB cluster to force a failover for. This parameter isn't case-sensitive.

Constraints:

  • Must match the identifier of an existing DB cluster.

Optional arguments:

IV_TARGETDBINSTANCEID TYPE /AWS1/RDSSTRING /AWS1/RDSSTRING

The name of the DB instance to promote to the primary DB instance.

Specify the DB instance identifier for an Aurora Replica or a Multi-AZ readable standby in the DB cluster, for example mydbcluster-replica1.

This setting isn't supported for RDS for MySQL Multi-AZ DB clusters.

RETURNING

OO_OUTPUT TYPE REF TO /AWS1/CL_RDSFAILOVERDBCLSTRS /AWS1/CL_RDSFAILOVERDBCLSTRS