This topic describes how to use Data Transmission Service (DTS) to create a reverse instance for incremental data synchronization in database disaster recovery scenarios. For more information about the feature, see Create a reverse task.
Background information
DTS allows you to create a reverse instance with a few clicks for a synchronization instance that is running as expected. You can use the reverse instance to synchronize incremental data back from the destination database to the source database. After you switch your workloads from the source database of a synchronization instance to the destination database, you can synchronize the incremental data written to the destination database back to the source database by using a reverse instance. This feature is often used for database disaster recovery.
Prerequisites
The source and destination databases of the original data synchronization instance are SQL Server databases, MySQL databases, or ApsaraDB for MongoDB instances, and incremental data synchronization is in progress.
The required permissions are granted to the destination database account of the original synchronization instance.
If you synchronize data between SQL Server databases, the destination database account of the original data synchronization instance must have the permissions of the sysadmin role. You can grant the required permissions to the destination database account by using the system administrator account to run the following command:
EXEC sp_addsrvrolemember @loginame = N'<Account name>', @rolename = N'sysadmin';
.If you synchronize data between MySQL databases, the destination database account of the original synchronization instance must be granted the REPLICATION CLIENT, REPLICATION SLAVE, SHOW VIEW, and SELECT permissions. For more information, see GRANT Statement.
If you synchronize data between ApsaraDB for MongoDB instances, the destination database account of the original data synchronization instance must have the read permissions on the source database, the admin database, and the local database. For more information, see Use DMS to manage database accounts.
Limits
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.
Procedure
Use one of the following methods to go to the Data Synchronization page and select the region in which the data synchronization instance resides.
DTS console
Log on to the DTS console.
In the left-side navigation pane, click Data Synchronization.
In the upper-left corner of the page, select the region in which the data synchronization instance resides.
DMS console
NoteThe actual operations may vary based on the mode and layout of the DMS console. For more information, see Simple mode and Customize the layout and style of the DMS console.
Log on to the DMS console.
In the top navigation bar, move the pointer over Data Development and choose
.From the drop-down list to the right of Data Synchronization Tasks, select the region in which the data synchronization instance resides.
Find the data synchronization instance that you want to manage.
Click the icon in the Actions column, and then select Create Reverse Task.
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.
NoteIf 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.
Pause the original instance.
On the Data Synchronization Tasks page, find the original instance.
In the Actions column, click the icon and select Pause Task.
In the Note message, click OK.
In the The task is paused. message, click OK.
Start the reverse instance.
On the Data Synchronization Tasks page, click the ID of the reverse instance.
In the Actions column, click the icon and select Start Reverse Task.
In the Note message, click OK.
FAQ
Can I create a reverse instance for a migration instance?
No. You can create a reverse instance only for a data synchronization instance between SQL Server databases, MySQL databases, or ApsaraDB for MongoDB instances.
What do I do if the Data Backups item fails the precheck of the reverse instance?
You must enable log backup in the source database and then run the precheck again. If your source database is a self-managed SQL Server database, click View Details in the Check Result column of the failed check item to view the backup method. If your source database is an ApsaraDB RDS for SQL Server database, you must manually back up your database. For more information, see the Configure manual backups section of the Back up an ApsaraDB RDS for SQL Server instance topic.