All Products
Search
Document Center

Data Transmission Service:Create a reverse instance

最終更新日:Nov 01, 2024

This topic describes how to create a reverse instance by using Data Transmission Service (DTS). This feature is used to synchronize data from a destination database back to the source database for database disaster recovery or workload switchover.

Prerequisites

Usage notes

  • You can create a reverse instance only for a data synchronization instance between SQL Server databases, MySQL databases, or ApsaraDB for MongoDB instances. You can select only Incremental Data Synchronization for the Synchronization Types parameter when you configure the reverse instance.

  • The data that is directly written to the destination database of the original synchronization instance before a reverse instance is created is not synchronized.

  • A precheck is immediately performed after a reverse instance is created. After the precheck is passed, DTS collects the incremental data but does not write the data to the source database of the original synchronization instance.

  • You can create only one reverse instance for each synchronization instance. After the reverse instance is started, the original synchronization instance cannot be directly started.

  • You cannot create a reverse instance for a cross-border synchronization instance.

  • The tables to be synchronized must have PRIMARY KEY or UNIQUE constraints, and all fields must be unique. Otherwise, duplicate data records may occur.

  • You must set the retention period of binary logs based on the estimated time that is required for database restoration if an exception occurs in the business database.

  • If the original synchronization instance is a DTS Serverless instance, the reverse instance that you create for the original synchronization instance supports only the pay-as-you-go billing method and the micro instance class. If the original synchronization instance is a subscription or pay-as-you-go instance, the billing method and instance class of the reverse instance that you create for the original synchronization instance are the same as those of the original synchronization instance by default.

  • If the original synchronization instance is used for cross-region data synchronization, you must select the region in which the source database of the original synchronization instance resides before you can view the reverse instance that is created for the original synchronization instance on the Data Synchronization Tasks page.

  • You are still charged for a created reverse instance during the period when the reverse instance is paused.

  • If the business database fails to be connected due to exceptions, DTS instances enter the Retrying state.

Procedure

Database disaster recovery scenarios

  1. Create a forward synchronization instance to synchronize data from the business database to the disaster recovery database based on your business requirements.

    Select an instance class based on your business requirements and configure the Retry Time for Failed Connections parameter based on the estimated time that is required for database restoration if an exception occurs in the business database. For more information about how to create a forward synchronization instance, see Configure one-way data synchronization between ApsaraDB RDS for MySQL instances, Synchronize data between ApsaraDB RDS for SQL Server instances, Synchronize data from an ApsaraDB for MongoDB replica set instance to an ApsaraDB for MongoDB replica set or sharded cluster instance, and Synchronize data from an ApsaraDB for MongoDB sharded cluster instance to an ApsaraDB for MongoDB replica set or sharded cluster instance.

  2. Wait until the forward synchronization instance enters the Running state and perform the following steps to create a reverse instance:

    1. On the Data Synchronization Tasks page, find the synchronization instance that you have created.

    2. Find the data synchronization instance that you want to manage, click the 更多设置 icon in the Actions column, and then select Create Reverse Task.

    3. In the Note message, click OK.

      Wait until the precheck of the reverse instance is complete and Performing Initial Synchronization is displayed in the Status column of the instance.

      Note
      • If Auto Refresh is disabled, you must click the 刷新 icon above the Actions column to refresh the state of the reverse instance.Status

      • If the precheck fails, click View Cause. On the page that appears, click View Details in the Check Result column of the failed check item. Follow the instructions to resolve the issue and run the precheck again.

    4. The reverse instance is created. No more operations are required if no exception occurs.

  3. If the business database fails to be connected due to exceptions, perform the following steps to restore your business:

    1. Pause the original instance.

      1. On the Data Synchronization Tasks page, find the original instance.

      2. In the Actions column, click the 更多设置 icon and select Pause Task.

      3. In the Note dialog box, click OK.

      4. In the The task is paused. message, click OK.

    2. Switch your workloads to the disaster recovery database.

    3. Start the reverse instance.

      1. On the Data Synchronization Tasks page, click the ID of the reverse instance.

      2. Optional. In the left-side navigation pane, click Task Management.

      3. In the Progress section, click the Incremental Write module.

      4. On the Basic Information tab, click Start Incremental Write next to Actions.

      5. In the Note message, click OK.

  4. After the business database is restored, perform the following steps to switch your workloads to the business database and restore the synchronization instances.

    1. Switch your workloads to the business database.

    2. Wait until the incremental synchronization task in the reverse direction is not delayed, pause the reverse instance.

      The reverse instance synchronizes the data that is directly written to the disaster recovery database back to the business database.

    3. Wait until the reverse instance is paused, start the forward synchronization instance.

Workload switchover scenarios

  1. Create a reverse instance.

    1. On the Data Synchronization Tasks page, find the forward synchronization instance, which is the original instance.

    2. Find the data synchronization instance that you want to manage, click the 更多设置 icon in the Actions column, and then select Create Reverse Task.

    3. In the Note message, click OK.

      Wait until the precheck of the reverse instance is complete and Performing Initial Synchronization is displayed in the Status column of the instance.

      Note
      • If Auto Refresh is disabled, you must click the 刷新 icon above the Actions column to refresh the state of the reverse instance.Status

      • If the precheck fails, click View Cause. On the page that appears, click View Details in the Check Result column of the failed check item. Follow the instructions to resolve the issue and run the precheck again.

    4. The reverse instance is created. No more operations are required if no exception occurs.

  2. Wait until the Incremental Data Collection module runs without latency.

    Click the ID of the reverse instance. In the Progress section of the Task Management page, view the state and latency of the module.

  3. Stop writing business data to the source database of the forward instance.

    To avoid data loss, suspend your business and stop writing data to the database.

  4. Pause the original instance.

    1. On the Data Synchronization Tasks page, find the original instance.

    2. In the Actions column, click the 更多设置 icon and select Pause Task.

    3. In the Note dialog box, click OK.

    4. In the The task is paused. message, click OK.

  5. Switch your workloads to the destination database of the forward instance.

  6. Start the reverse instance.

    1. On the Data Synchronization Tasks page, click the ID of the reverse instance.

    2. Optional. In the left-side navigation pane, click Task Management.

    3. In the Progress section, click the Incremental Write module.

    4. On the Basic Information tab, click Start Incremental Write next to Actions.

    5. In the Note message, click OK.

  7. Terminate or release the forward instance.

    For more information, see Terminate a DTS instance and Release DTS instances.

FAQ

  • How do I select an instance class when I create a forward synchronization instance?

    We recommend that you select the micro instance class that has the smallest maximum records per second (RPS). After you create a reverse instance, you can upgrade the instance based on your business requirements. For more information, see Upgrade a DTS instance.

  • What do I do if a DTS instance is in the Failed state after the business database is restored?

    Start the DTS task. For more information, see Start a DTS task.