1
, 3
, and 5
are updated in database A, while data records with primary keys 2
, 4
, and 6
are updated in database B). If there are duplicate primary keys in the two source databases for business reasons, select an appropriate conflict resolution policy as instructed in Recommended Configurations for Typical Use Cases to make the sync behavior and data meet the expectations.Scenario | Time Requirements | Sync Task | Initialization Type | If Target Already Exists | Conflict Resolution Method | SQL Type |
Scenario 1: Instance A has database/table structures and data, and instance B is empty | Task 2 can be created only after task 1 enters the "incremental sync" phase | Task 1: Forward sync (A < B) | Structure initialization/full data initialization | Precheck and report error | Select an option as needed. Example: If a primary key conflict occurs, and you want the content of database A to prevail, you need to select **Overwrite** for task 1 and **Ignore** or **Report** for task 2. The conflict resolution method takes effect only for the data with primary key conflict. | Select DDL in at most one task. For operation types other than DDL, keep them consistent between the two tasks. |
| | | | Task 2: Reverse sync (B > A) | Do not select | Ignore and execute |
| | Scenario 2: Instance A has database/table structures and data, and instance B has only database/table structures but no data | None | Task 1: Forward sync (A > B) | Full data initialization | Ignore and execute |
| | | | Task 2: Reverse sync (B > A) | Do not select | Ignore and execute |
| | Scenario 3: Both instances A and B have database/table structures and data | None | Task 1: Forward sync (A > B) | Full data initialization | Ignore and execute |
| | | | Task 2: Reverse sync (B > A) | Full data initialization | Ignore and execute |
Category | Parameter | Description |
Task Configuration | Task Name | DTS will automatically generate a task name, which is customizable. |
| Running Mode | Immediate execution and scheduled execution are supported. |
Source Instance Settings | Source Instance Type | The database A type selected during purchase, which cannot be changed. |
| Source Instance Region | The database A region selected during purchase, which cannot be changed. |
| Service Provider | Select **Others**. |
| Access Type | For a third-party cloud database, you can select **Public Network** generally or select **VPN Access**, **Direct Connect**, or **CCN** based on your actual network conditions. In this scenario, **Public Network** is selected as an example. For the preparations for different access types, see Overview. |
Target Instance Settings | Target Instance Type | The target database B type selected during purchase, which cannot be changed. |
| Target Instance Region | The target database B region selected during purchase, which cannot be changed. |
| Access Type | In this scenario, select **Database**. |
| Instance ID | Instance ID of database B. |
| Account | Account of database B, which must have the required permissions. |
| Password | Password of database B. |
Category | Parameter | Description |
Data Initialization Option | Initialization Type | In this scenario, select **Structure initialization/Full data initialization**. Structure initialization: Table structures in the source instance will be initialized into the target instance before the sync task runs. Full data initialization: Data in the source instance will be initialized into the target database before the sync task runs. |
| If Target Already Exists | In this scenario, select **Precheck and report error**. Precheck and report error: If a table with the same name exists in both the source and target databases, an error will be reported, and the task will stop. Ignore and execute: Full and incremental data will be directly added to tables in the target instance. |
Data Sync Option | Conflict Resolution Method | Select a conflict resolution policy based on the business conditions. In this scenario, select **Overwrite**. Report: If a primary key conflict is found during data sync, an error will be reported, and the data sync task will be paused. Ignore: If a primary key conflict is found during data sync, the primary key record in the target database will be retained. Overwrite: If a primary key conflict is found during data sync, the primary key record in the source database will overwrite that in the target database. |
| SQL Type | Supported operations include INSERT, UPDATE, DELETE, and DDL. If you select **Custom DDL**, you can select different DDL statement sync policies as needed. For more information, see Setting SQL Filter Policy.In two-way sync, you can select **DDL** in at most one task. In this scenario, select **DDL** in task 1 but not task 2. |
Sync Object Option | Database and Table Objects of Source Instance | Select the objects to be synced. |
| Selected Object | Database/Table mapping (renaming) is supported. Hover over a database or table name, click the displayed **Edit** icon, and enter a new name in the pop-up window. |
Was this page helpful?