Data Transmission Service (DTS) lets you continuously synchronize data from a self-managed Db2 for LUW database to a PolarDB-X 2.0 instance. The synchronization covers a full initial load and ongoing incremental changes captured through the Change Data Capture (CDC) replication mechanism built into Db2 for LUW.
Prerequisites
Before you begin, make sure that you have:
A Db2 for LUW source database and a PolarDB-X 2.0 destination instance. The PolarDB-X instance must be compatible with MySQL 5.7. For supported synchronization scenarios, see Overview of data synchronization scenarios
Enough free storage space on the destination instance to hold all data from the source database
Data logging enabled on the Db2 for LUW database. If data logging is disabled, the precheck fails and the task cannot start
Synchronization type Log retention requirement Incremental data synchronization only More than 24 hours Full data synchronization + incremental data synchronization At least 7 days. After the full data synchronization phase completes, you can set the retention period to more than 24 hours. Otherwise, DTS may fail to obtain the data logs and the task may fail. In exceptional circumstances, data inconsistency or loss may occur. CDC enabled for every table you want to synchronize
Log archiving configured for the Db2 for LUW database. See logarchmeth1 and logarchmeth2
The required database account permissions granted:
Database Required permission Reference Db2 for LUW DBADM authority Creating group and user IDs, Authorities overview PolarDB-X 2.0 Read and write permissions on the destination database Manage accounts
Billing
| Synchronization type | Cost |
|---|---|
| Schema synchronization and full data synchronization | Free |
| Incremental data synchronization | Charged. See Billing overview |
Supported synchronization topologies
One-way one-to-one synchronization
One-way one-to-many synchronization
One-way cascade synchronization
One-way many-to-one synchronization
For details, see Synchronization topologies.
Supported DML operations
DTS synchronizes INSERT, UPDATE, and DELETE statements. DDL synchronization is not supported for this source-destination pair.
Limitations
Limitations that apply to all synchronization types
| Category | Limitation |
|---|---|
| Source bandwidth | The server hosting the source database must have sufficient outbound bandwidth. Insufficient bandwidth reduces synchronization speed. |
| Table constraints | Tables to be synchronized must have a PRIMARY KEY or UNIQUE constraint, with all fields unique. Without this, the destination database may contain duplicate records. |
| Table count | If you select tables as synchronization objects and plan to rename tables or columns in the destination database, a single task supports up to 5,000 tables. For more than 5,000 tables, configure multiple tasks or synchronize the entire database instead. |
| Foreign key behavior | DTS synchronizes foreign keys from the source to the destination database. During full data synchronization and incremental data synchronization, DTS temporarily disables constraint checks and cascade operations on foreign keys at the session level. Cascade UPDATE or DELETE operations on the source during synchronization may cause data inconsistency. |
| Write behavior | Write data to the destination database only through DTS during the synchronization period. After synchronization is complete, use Data Management (DMS) to run DDL statements online. See Perform lock-free DDL operations. |
| Tablespace size | After initial full data synchronization, concurrent INSERT operations cause table fragmentation in the destination. As a result, the destination tablespace may be larger than the source. |
| Performance impact | The initial full data synchronization phase consumes read and write resources on both source and destination database servers. Evaluate the impact before you start, and run synchronization during off-peak hours when possible. |
Limitations that apply to incremental data synchronization only
DTS captures incremental data using the CDC replication technology built into Db2 for LUW. CDC monitors transaction logs and applies changes to the destination.
| Category | Limitation |
|---|---|
| Synchronization latency accuracy | DTS calculates synchronization latency by comparing the timestamp of the latest synchronized record in the destination against the current source timestamp. If no DML operations occur on the source for an extended period, the reported latency may be inaccurate. To update the latency, run a DML operation on the source. If you synchronize an entire database, create a heartbeat table that receives a write every second. |
| Primary/secondary switchover | If a primary/secondary switchover occurs on the source while the task is running, the task fails. |
| CDC-specific restrictions | For the full list of CDC restrictions, see General data restrictions for SQL Replication. |
Create a synchronization task
The task configuration follows five steps: configure source and destination databases, test connectivity, select objects, run the precheck, and purchase the instance.
Step 1: Configure source and destination databases
Go to the Data Synchronization page in the DTS console.
Alternatively, log on to the DMS console, move the pointer over Data + AI in the top navigation bar, and choose DTS (DTS) > Data Synchronization.
In the upper-left corner, select the region where the synchronization instance will reside.
Click Create Task. In the Create Data Synchronization Task wizard, configure the source and destination database parameters:
Source database
Parameter Description Task Name A name for the task. DTS generates a default name. Specify a descriptive name to make the task easy to identify. The name does not need to be unique. Database Type Select DB2 LUW. Connection Type Select the access method based on where your source database is deployed. This example uses Self-managed Database on ECS. If your source is a self-managed database, set up the network environment first. See Preparation overview. Instance Region The region where the Db2 for LUW database resides. ECS Instance ID The ID of the Elastic Compute Service (ECS) instance hosting the Db2 for LUW database. Port Number The service port of the Db2 for LUW database. Default: 50000. Database Name The name of the source Db2 for LUW database containing the objects to synchronize. Database Account The Db2 for LUW database account. See Prerequisites for required permissions. Database Password The password for the database account. Destination database
Parameter Description Database Type Select PolarDB-X 2.0. Connection Type Select Alibaba Cloud Instance. Instance Region The region where the destination PolarDB-X instance resides. Instance ID The ID of the destination PolarDB-X cluster. Database Account The PolarDB-X database account. See Prerequisites for required permissions. Database Password The password for the database account.
Step 2: Test connectivity
Click Test Connectivity and Proceed.
DTS automatically adds its server CIDR blocks to the whitelist or security group of Alibaba Cloud database instances. For self-managed databases on ECS, DTS adds its CIDR blocks to the ECS security group — make sure the ECS instance can reach the database. If the database runs across multiple ECS instances, manually add the DTS CIDR blocks to each instance's security group rules. For self-managed databases in a data center or hosted by a third-party cloud provider, manually add the DTS CIDR blocks to the database whitelist. See CIDR blocks of DTS servers.
Adding DTS CIDR blocks to whitelists or security groups introduces security exposure. Before proceeding, take preventive measures such as strengthening credentials, limiting exposed ports, authenticating API calls, reviewing whitelist rules regularly, and removing unauthorized CIDR blocks. Consider connecting via Express Connect, VPN Gateway, or Smart Access Gateway as a more secure alternative.
Step 3: Select objects and configure settings
Basic settings
| Parameter | Description |
|---|---|
| Synchronization Types | Incremental Data Synchronization is selected by default. You can also select Full Data Synchronization. Schema Synchronization is not available for this source-destination pair. |
| Processing Mode of Conflicting Tables | Precheck and Report Errors: checks whether the destination contains tables with the same names as the source. If identical names exist, the precheck fails and the task cannot start. To resolve naming conflicts, use the object name mapping feature. See Map object names. Ignore Errors and Proceed: skips the identical table name check. During full data synchronization, records with matching primary or unique key values are retained in the destination without being overwritten. During incremental data synchronization, matching records in the destination are overwritten. If the schemas differ between source and destination, some columns may not be synchronized or the task may fail. |
| Select Objects | In the Source Objects panel, select the objects to synchronize and click the arrow icon to move them to the Selected Objects panel. You can select columns, tables, or databases. If you select tables or columns, DTS does not synchronize views, triggers, or stored procedures. |
| Rename databases and tables | To rename a single object, right-click it in the Selected Objects panel. See Map the name of a single object. To rename multiple objects at once, click Batch Edit in the upper-right corner of the Selected Objects panel. See Map multiple object names at a time. |
| Filter data | Specify WHERE conditions to filter rows. See Specify filter conditions. |
| Select SQL operations to synchronize | In the Selected Objects panel, right-click an object and select the SQL operations to synchronize. |
Advanced settings
| Parameter | Description |
|---|---|
| Monitoring and Alerting | Select Yes to configure alerts for task failures or high synchronization latency. Specify the alert threshold and notification contacts. See Configure monitoring and alerting. Select No to skip alerting. |
| Retry Time for Failed Connections | The time window (in minutes) during which DTS retries failed connections after the task starts. Valid values: 10–1440. Default: 720. Set this to at least 30 minutes. If DTS reconnects within the window, the task resumes automatically. If the window expires without a successful connection, the task fails. If multiple tasks share the same source or destination database, the shortest retry window among them takes effect. DTS charges for the instance during retry periods. |
Step 4: Run the precheck
Click Next: Save Task Settings and Precheck.
To review the OpenAPI parameters for this configuration before saving, hover over the button and click Preview OpenAPI parameters.
DTS runs a precheck before the task starts. If the precheck fails:
For a failed item: click View Details, fix the issue, and run the precheck again.
For an alert item that can be ignored: click Confirm Alert Details, then click Ignore in the dialog box, and click OK. Then click Precheck Again. Ignoring alerts may cause data inconsistency.
For an alert item that cannot be ignored: click View Details, fix the issue, and run the precheck again.
Step 5: Purchase the instance
Wait until Success Rate reaches 100%, then click Next: Purchase Instance.
On the purchase page, configure the billing and instance settings:
Parameter Description Billing Method Subscription: pay upfront for a fixed term. More cost-effective for long-term use. Pay-as-you-go: billed hourly. Suitable for short-term use. Release the instance when no longer needed to stop charges. Resource Group Settings The resource group for the synchronization instance. Default: default resource group. See What is Resource Management? Instance Class DTS instance classes vary in synchronization speed. See Instance classes of data synchronization instances. Subscription Duration Available only for the Subscription billing method. Options: 1–9 months, 1 year, 2 years, 3 years, or 5 years. Read and select Data Transmission Service (Pay-as-you-go) Service Terms.
Click Buy and Start, then click OK in the confirmation dialog.
The task appears in the task list. You can monitor its progress from there.
What's next
Map object names — rename objects in the destination without modifying the source
Synchronization topologies — explore multi-source and multi-destination topologies
Configure monitoring and alerting — set up alerts for task failures and latency thresholds