This topic describes how to switch workloads over between a primary ApsaraDB RDS for SQL Server instance and its secondary RDS instance. ApsaraDB RDS for SQL Server supports both manual switchovers and automatic switchovers. After a switchover is complete, the primary RDS instance becomes the secondary RDS instance.

Prerequisites

Your RDS instance runs the RDS High-availability or Cluster Edition.

Note RDS instances that run the RDS Basic Edition do not have secondary RDS instances as their standbys. Therefore, these RDS instances do not support primary/secondary switchovers.

Background information

  • Automatic switchover: By default, the automatic switchover feature is enabled. If the primary RDS instance becomes faulty, ApsaraDB RDS automatically switches workloads over to the secondary RDS instance.
  • Manual switchover: You can manually switch workloads over between the primary and secondary RDS instances even if the automatic switchover feature is enabled.
Note Data is synchronized in real time between the primary and secondary RDS instances. You can access only the primary RDS instance. The secondary RDS instance serves only as a standby and does not allow external access.

Precautions

  • You may encounter a transient connection during a switchover. Make sure that your application is configured to automatically reconnect to your database system.
  • If the primary RDS instance is attached with read-only RDS instances, the read-only RDS instances need to re-establish the connections that are used for data replication and synchronize incremental data after a switchover. As a result, data on the read-only RDS instances shows latencies of a few minutes.
  • The high-availability synchronization mechanism of SQL Server can ensure that the full data of all databases is synchronized between the primary and secondary RDS instances. However, this mechanism cannot ensure that the logon-related parameters are synchronized. The following logon-related parameters can be synchronized: SID, username, and password. The other logon-related parameters are configured to their default values.

Precautions

  • You may encounter a transient connection during a switchover. Make sure that your application is configured to automatically reconnect to your database system.
  • If the primary RDS instance is attached with read-only RDS instances, the read-only RDS instances need to re-establish the connections that are used for data replication and synchronize incremental data after a switchover. As a result, data on the read-only RDS instances shows latencies of a few minutes.

Perform a manual switchover

  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Service Availability.
  3. In the Availability Information section of the page that appears, click Switch Primary/Secondary Instance.
  4. Specify the time when you want to perform a switchover. Then, click OK.
    Note A number of operations cannot be performed during the switchover. For example, you cannot manage databases or accounts, and you cannot change the network type. We recommend that you select Switch Within Maintenance Window.

Temporarily disable the automatic switchover feature

The automatic switchover feature is enabled by default. If the primary RDS instance becomes faulty, ApsaraDB RDS automatically switches workloads over to the secondary RDS instance. However, you can disable the automatic switchover feature in the following scenarios:

  • A sales promotion, during which you do not want a switchover to affect system availability.
  • An important application upgrade, during which you do not want a switchover to cause unexpected issues.
  • A major event that requires stable system operation, during which you do not want a switchover to affect system stability.
  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Service Availability.
  3. In the Availability Information section of the page that appears, click Configure Primary/Secondary Switchover.
    Note If you cannot find Configure Primary/Secondary Switchover, you must check that your RDS instance runs the RDS High-availability Edition.
  4. Select Disable Temporarily, set the Deadline: parameter, and then click OK.
    Note
    • When the specified Deadline: arrives, the automatic switchover feature is automatically enabled for your RDS instance.
    • By default, the automatic switchover feature is disabled for one day. You can set the Deadline parameter to 23:59:59 seven days later at most.

After you disable the automatic switchover feature, you can go to the Service Availability page to check the deadline before which the automatic switchover feature is disabled.

Related operations

Operation Description
Switch services between a primary ApsaraDB for RDS instance and its secondary instance Switches workloads over between primary and secondary ApsaraDB RDS instances.
Enable or disable automatic primary/secondary switchover Enables or disables the automatic switchover feature for an ApsaraDB RDS instance.
Query settings of automatic primary/secondary switchover Queries the status of the automatic switchover feature for an ApsaraDB RDS instance.