This topic describes how to use Data Transmission Service (DTS) to create a reverse instance for incremental data synchronization in a database disaster recovery scenario. For more information about this feature, see Create a reverse task.
Background information
DTS allows you to create a reverse instance for a running synchronization instance with a single click. When your workloads are switched from the source database to the destination database, the reverse instance synchronizes the incremental data generated after the switchover back to the original source database. This process is often used for data failback in disaster recovery scenarios.
Prerequisites
-
The original instance is a synchronization instance between SQL Server databases, MySQL databases, or ApsaraDB for MongoDB instances, and the incremental data synchronization is in progress.
-
The destination database account for the original instance must have the required permissions.
-
For a synchronization instance between SQL Server databases: The destination database account must have the permissions of the
sysadminrole. To grant these permissions, use a privileged account to run the following command:EXEC sp_addsrvrolemember @loginame = N'<Account name>', @rolename = N'sysadmin'; -
For a synchronization instance between MySQL databases: The destination database account must also have the
REPLICATION CLIENT,REPLICATION SLAVE,SHOW VIEW, andSELECTpermissions. For information about how to grant permissions, see the MySQL official documentation. -
For a synchronization instance between ApsaraDB for MongoDB instances: The destination database account must also have the
readpermissions on the database to be synchronized, theadmindatabase, and thelocaldatabase. For more information, see Manage database accounts by using DMS.
-
Usage notes
-
You can create a reverse instance only for a synchronization instance between SQL Server databases, MySQL databases, or ApsaraDB for MongoDB instances. For the reverse instance, only Incremental Data Synchronization can be selected for Synchronization Types.
ImportantIf the original synchronization instance involves SQL Server or MySQL databases, this feature is supported only when the destination database is an ApsaraDB database instance.
-
The reverse instance does not synchronize data written directly to the destination database before the reverse instance is created.
-
After a reverse instance is created, a precheck runs immediately. If the precheck passes, DTS starts to capture incremental data, but the incremental data writing module does not run.
-
To prevent data inconsistency or instance failure, pause the original instance before you start the corresponding reverse instance.
-
You can create only one reverse instance for each synchronization instance. After the reverse instance starts, you cannot directly start the original instance.
-
You cannot create a reverse instance for a cross-region or cross-country synchronization instance.
Procedure
Go to the data synchronization task list page in the destination region. You can do this in one of two ways.
DTS console
Log on to the DTS console.
In the navigation pane on the left, click Data Synchronization.
In the upper-left corner of the page, select the region where the synchronization instance is located.
DMS console
NoteThe actual steps may vary depending on the mode and layout of the DMS console. For more information, see Simple mode console and Customize DMS console layout and style.
Log on to the DMS console.
In the top menu bar, choose .
To the right of Data Synchronization Tasks, select the region of the synchronization instance.
-
Find the target instance.
-
In the Actions column for the target instance, choose .
-
In the Note dialog box, click OK.
Wait for the precheck of the reverse instance to complete, at which point the Status changes to Performing Initial Synchronization.
Note-
If Auto Refresh is disabled, you must manually click the
icon above the Actions column to update the Status of the synchronization instance. -
If the precheck fails, click View Cause. Then, click View Details for the failed check item, fix the issue as prompted, and run the precheck again.
-
-
Pause the original instance.
-
On the Data Synchronization Tasks page, find the original instance.
-
In the Actions column for the target instance, choose .
-
In the Note dialog box, click OK.
-
In the Task Paused dialog box, click OK.
-
-
Start the reverse instance.
-
On the Data Synchronization Tasks page, find the newly created reverse instance.
-
In the Actions column for the target instance, choose .
-
In the Note dialog box, click OK.
-
FAQ
-
Can I create a reverse instance for a data migration instance?
No. This feature is supported only for synchronization instances between SQL Server databases, MySQL databases, or ApsaraDB for MongoDB instances.
-
What do I do if a reverse instance fails the Data Backups check during the precheck?
You must perform a log backup on the source database and run the precheck again. If your source database is a self-managed SQL Server instance, click View Details for the failed item to see the required backup method. If your source database is an ApsaraDB RDS for SQL Server instance, see Manually create a backup.
> Create Reverse Task