ApsaraDB RDS for SQL Server supports the inter-instance database replication feature. You can replicate databases on an ApsaraDB RDS for SQL Server instance to another ApsaraDB RDS for SQL Server instance.

Prerequisites

The RDS instances meet the following requirements:
  • The source and destination RDS instances belong to the same Alibaba Cloud account.
  • The major engine versions of the source and destination RDS instances are the same. The following list describes the supported major engine versions:
    • SQL Server 2012
    • SQL Server 2016
    • SQL Server 2008 R2 with standard SSDs or enhanced SSDs (ESSDs)
  • The region and network type of the source RDS instance must be the same as those of the destination RDS instance. The zones of the source and destination RDS instances can be different.
  • The destination RDS instance does not have databases whose names are the same as those of the databases that you want to replicate from the source RDS instance.
  • The available storage of the destination RDS instance is larger than the total size of the databases that you want to replicate from the source RDS instance.

Description

During the replication process, ApsaraDB RDS first performs a full backup on the source RDS instance and then replicates the full data to the destination RDS instance. If data is written to the source RDS instance during the replication, incremental data of the source RDS instance is not replicated to the destination RDS instance.

You can choose to replicate a single database or all databases in the source RDS instance. If the replication task fails, no data is replicated to the destination RDS instance. This ensures data consistency.

Comparison between the database replication feature of ApsaraDB RDS and the data migration feature of DTS

Item Database replication Data migration
Principle ApsaraDB RDS replicates databases from the source RDS instance to the destination RDS instance by using data backup files or to a point in time. The feature does not delete data from the source RDS instance. The data migration feature that is provided by Data Transmission Service (DTS) performs logical migration. You can use the data migration feature to read and parse the logs of the source instance to migrate the data. A complete data migration process consists of three phases: schema migration, full data migration, and incremental data migration. The feature does not delete data from the source instance.
Data source ApsaraDB RDS for SQL Server instances. Self-managed databases that are deployed on Elastic Compute Service (ECS) instances, self-managed databases that are deployed in data centers, self-managed databases that are deployed on third-party cloud servers, and ApsaraDB RDS for SQL Server instances. For more information, see Supported databases.
Implementation Only one-time full replication is supported. The one-time full replication is free of charge. Schema migration, full data migration, and incremental data migration are supported. For more information about the charges for incremental data migration, see Billing overview.

Procedure

  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane, click Databases.
  3. Click Replicate to Another Instance. In the dialog box that appears, configure the parameters.
    Parameter Description
    Source Instance Name The name of the source RDS instance. The name is automatically displayed.
    Target Instance Name

    The ID of the destination RDS instance.

    The drop-down list displays all the RDS instances that reside in the same region and use the same SQL Server version as the source RDS instance. You can select the destination RDS instance from the drop-down list.

    Source Databases

    The databases that you want to replicate to the destination RDS instance. You can click the 1 or 2 icon to select the databases.

    If you select more than one database or all databases, make sure that the following conditions are met:
    • The available storage of the destination RDS instance is larger than the total size of the databases that you want to replicate from the source RDS instance.
    • The destination RDS instance does not have databases whose names are the same as those of the databases that you want to replicate from the source RDS instance.
    Note
    • If the source and destination RDS instances have databases whose names are the same, these databases are not replicated.
    • If you select a database, the schemas and data of tables in the database are replicated.
    Source Databases

    Specify whether to replicate accounts and account permissions to the destination RDS instance.

    • Synchronize Database Users and Authorizations: Accounts and account permissions are replicated to the destination RDS instance. Take note of the following two scenarios:
      • If the destination RDS instance has accounts whose usernames are the same as those of accounts on the source RDS instance, the accounts on the destination RDS instance are granted the same permissions as the accounts on the source RDS instance.
      • If the destination RDS instance does not have the same accounts, the accounts are first created on the destination RDS instance and then granted the same permissions as the accounts on the source RDS instance.
    • Replicate Database Only. Do Not Synchronize Users and Authorizations: Accounts and account permissions are not replicated to the destination RDS instance. This option is the default value. After replication is complete, you can create accounts on the destination RDS instance and grant permissions on the selected databases. For more information, see Create an account and a database for an ApsaraDB RDS instance that runs SQL Server 2012, 2016, 2017 SE, or 2019 SE and Create an account and a database for an ApsaraDB RDS instance that runs SQL Server 2008 R2.
  4. Click OK.