Use Data Transmission Service (DTS) to migrate data from a PolarDB for MySQL cluster to a self-managed Oracle database. DTS supports schema migration, full data migration, and incremental data migration.
Prerequisites
Before you begin, make sure that:
-
The destination Oracle database is created and has storage space larger than the total data size of the source PolarDB for MySQL cluster.
-
If the destination is an Oracle Real Application Cluster (RAC) database connected to Alibaba Cloud via Virtual Private Cloud (VPC): each Single Client Access Name (SCAN) IP and the virtual IP address (VIP) of each node are connected to the VPC, and routing rules are configured. For setup instructions, see Connect an on-premises database to Alibaba Cloud and Connect a data center to DTS by using VPN Gateway.
Limitations
High-impact limitations
Review these limitations before starting — they can cause task failure or data loss:
-
Read-only nodes cannot be migrated. Only the primary node of the source PolarDB for MySQL cluster is supported.
-
No DDL during schema migration or full data migration. If you run DDL operations that change database or table schemas on the source during these phases, the migration task fails.
-
Do not write to the source during full-only migration. If you run schema migration and full data migration without incremental migration, writing to the source causes data inconsistency. To keep the source online, select all three migration types: schema migration, full data migration, and incremental data migration.
-
Binary logging required for incremental migration. Binary logging must be enabled and
loose_polar_log_binmust be set toon. If not configured, precheck fails. See Enable binary logging and Modify parameters. Required binary log retention: After full migration completes, you can reduce retention to more than 24 hours. Insufficient retention causes DTS to fail when fetching binary logs, which may result in task failure or data loss.NoteEnabling binary logging on PolarDB for MySQL incurs storage charges for the binary log files.
Migration type Minimum retention period Incremental data migration only More than 24 hours Full data migration + incremental data migration At least 7 days -
Stop the migration task before switching workloads. DTS retries failed tasks for up to 7 days. If a failed task resumes after you switch workloads to the destination, it overwrites destination data with source data. Before switching, stop or release the migration task, or run
REVOKEto remove write permissions from DTS accounts on the destination database.
Other limitations
-
Tables must have PRIMARY KEY or UNIQUE constraints with all fields unique. Without these constraints, the destination database may contain duplicate records.
-
Table rename limit. If you select tables as migration objects and need to rename tables or columns in the destination, a single task supports up to 1,000 tables. For more than 1,000 tables, split the migration across multiple tasks or migrate the entire database instead.
-
Oracle RAC over Express Connect, VPN Gateway, Smart Access Gateway, Database Gateway, Cloud Enterprise Network (CEN), or ECS: use a single VIP rather than a SCAN IP. Node failover is not supported after specifying the VIP.
-
Migrate during off-peak hours to minimize performance impact. Full data migration uses read and write resources on both databases and increases server load.
-
Destination tablespace grows after full migration. Concurrent INSERT operations during full migration cause table fragmentation. The destination tablespace will be larger than the source tablespace after full migration.
-
FLOAT and DOUBLE precision. DTS uses
ROUND(COLUMN, PRECISION)to retrieve FLOAT and DOUBLE values. Default precision: FLOAT uses 38 digits, DOUBLE uses 308 digits. Verify these settings meet your requirements before starting. -
Source server bandwidth. The source server must have sufficient outbound bandwidth. Insufficient bandwidth reduces migration speed.
Foreign key behavior
DTS migrates foreign keys during schema migration. During full data migration and incremental data migration, DTS temporarily disables foreign key constraint checks and cascade operations at the session level. If you perform cascade or delete operations on the source during migration, data inconsistency may occur.
Special case
DTS executes CREATE DATABASE IF NOT EXISTS \test\`` on the source database on a schedule to advance the binary log file position. This is expected behavior.
Billing
| Migration type | Instance configuration fee | Internet traffic fee |
|---|---|---|
| Schema migration and full data migration | Free | Charged only when data is migrated from Alibaba Cloud over the Internet. See Billing overview. |
| Incremental data migration | Charged. See Billing overview. | — |
SQL operations supported for incremental migration
| Operation type | SQL statements |
|---|---|
| DML | INSERT, UPDATE, DELETE |
| DDL | CREATE TABLE, ALTER TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE, ADD COLUMN, DROP COLUMN, MODIFY COLUMN, RENAME COLUMN, CREATE INDEX, DROP INDEX |
Required database account permissions
| Database | Required permission | Reference |
|---|---|---|
| Source PolarDB for MySQL cluster | Read permissions on the objects to be migrated | Create and manage a database account |
| Destination Oracle database | Schema owner permissions | CREATE USER and GRANT |
Create a migration task
Step 1: Go to the Data Migration Tasks page
-
Log on to the Data Management (DMS) console.
-
In the top navigation bar, click DTS.
-
In the left-side navigation pane, choose DTS (DTS) > Data Migration.
Console layout may vary. See Simple mode and Customize the layout and style of the DMS console. You can also go directly to the Data Migration Tasks page of the new DTS console.
Step 2: Select the region
From the drop-down list next to Data Migration Tasks, select the region where the data migration instance resides.
In the new DTS console, select the region in the upper-left corner.
Step 3: Configure source and destination databases
Click Create Task and configure the following parameters.
Task settings
| Parameter | Description |
|---|---|
| Task Name | The name of the DTS task. DTS automatically generates a task name. We recommend that you specify a descriptive name that makes it easy to identify the task. You do not need to specify a unique task name. |
Source database
| Parameter | Description |
|---|---|
| Select an existing DMS database instance | Optional. Select an existing instance to auto-populate database parameters, or leave blank to configure manually. |
| Database Type | Select PolarDB for MySQL. |
| Access Method | Select Alibaba Cloud Instance. |
| Instance Region | The region of the source PolarDB for MySQL cluster. |
| Replicate Data Across Alibaba Cloud Accounts | Select No for same-account migrations. |
| PolarDB Cluster ID | The ID of the source PolarDB for MySQL cluster. |
| Database Account | The database account for the source cluster. See Required database account permissions. |
| Database Password | The password for the database account. |
| Encryption | Whether to encrypt the connection to the source database. See Configure SSL encryption. |
Destination database
| Parameter | Description |
|---|---|
| Select an existing DMS database instance | Optional. Select an existing instance to auto-populate database parameters, or leave blank to configure manually. |
| Database Type | Select Oracle. |
| Access Method | Select Self-managed Database on ECS for this example. For other access methods, see Preparation overview. |
| Instance Region | The region where the destination Oracle database resides. |
| ECS Instance ID | The ID of the ECS instance hosting the destination Oracle database. |
| Port Number | The service port of the destination Oracle database. Default: 1521. |
| Oracle Type | The architecture of the destination Oracle database: Non-RAC Instance (requires SID) or RAC or PDB Instance (requires Service Name). This example uses RAC or PDB Instance. |
| Database Account | The database account for the destination Oracle database. See Required database account permissions. |
| Database Password | The password for the database account. |
Step 4: Test connectivity
Click Test Connectivity and Proceed.
DTS automatically adds its CIDR blocks to the IP address whitelist of Alibaba Cloud database instances and to the security group rules of ECS-hosted databases. For self-managed databases in a data center or on a third-party cloud, manually add the DTS CIDR blocks to your database whitelist. See Add the CIDR blocks of DTS servers.
Adding DTS CIDR blocks to a database whitelist or ECS security group introduces security risks. Before proceeding, take preventive measures such as: strengthening account credentials, limiting exposed ports, authenticating API calls, reviewing whitelist and security group rules regularly, and removing unauthorized CIDR blocks. Alternatively, connect the database to DTS over Express Connect, VPN Gateway, or Smart Access Gateway.
Step 5: Configure migration objects and settings
| Parameter | Description |
|---|---|
| Migration Types | Select Schema Migration and Full Data Migration for a one-time migration. Select Schema Migration, Full Data Migration, and Incremental Data Migration to keep services running during migration. Note
Without incremental migration, do not write to the source database during migration. |
| Processing Mode of Conflicting Tables | Precheck and Report Errors: checks for tables with identical names in source and destination. The task fails precheck if conflicts exist. Use object name mapping to resolve conflicts — see Map object names. Ignore Errors and Proceed: skips the check. Data records with matching primary keys are not migrated. If schemas differ, only specific columns may be migrated or the task may fail. |
| Capitalization of Object Names in Destination Instance | Controls capitalization of database, table, and column names in the destination. Default: DTS default policy. See Specify the capitalization of object names in the destination instance. |
| Source Objects | Select objects from the Source Objects list and click |
| Selected Objects | To rename a database in the destination, right-click it and set Schema Name in the Edit Schema dialog box. To filter rows by condition, right-click a table and specify WHERE conditions. See Set filter conditions. To select specific SQL operations for a database or table, right-click the object and select the operations. Note
Renaming an object may cause dependent objects to fail migration. |
Step 6: Configure advanced settings
Click Next: Advanced Settings.
Data verification
To configure data verification, see Configure data verification.
Advanced settings
| Parameter | Description |
|---|---|
| Select the dedicated cluster used to schedule the task | By default, DTS uses a shared cluster. To use a dedicated cluster, purchase one first. See What is a DTS dedicated cluster? |
| Retry Time for Failed Connections | How long DTS retries after a connection failure. Range: 10–1440 minutes. Default: 720. Set to more than 30 minutes for reliability. If DTS reconnects within this window, the task resumes. Otherwise, it fails. Note
The most recently specified value takes precedence when multiple tasks share the same database. DTS instance charges continue during retries. |
| The wait time before a retry when other issues occur in the source and destination databases | How long DTS retries after DDL or DML failures. Range: 1–1440 minutes. Default: 10. Set to more than 10 minutes. Must be less than Retry Time for Failed Connections. |
| Enable Throttling for Full Data Migration | Limits DTS read/write load on databases during full migration. Configure Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s). Available only when Full Data Migration is selected. |
| Enable Throttling for Incremental Data Migration | Limits DTS load during incremental migration. Configure RPS of Incremental Data Migration and Data migration speed for incremental migration (MB/s). Available only when Incremental Data Migration is selected. |
| Environment Tag | A tag to identify the DTS instance. Optional. |
| Whether to delete SQL operations on heartbeat tables of forward and reverse tasks | Controls whether DTS writes heartbeat SQL to the source database. Yes: does not write heartbeat SQL (task latency may show in monitoring). No: writes heartbeat SQL (may affect source database features such as physical backup and cloning). |
| Configure ETL | Whether to enable extract, transform, and load (ETL). Yes: configure ETL using the code editor. See Configure ETL in a data migration or data synchronization task. No: skip ETL. See What is ETL? |
| Monitoring and Alerting | Whether to configure alerts for task failures or latency exceeding a threshold. Yes: specify alert threshold and contacts. See Configure monitoring and alerting for a new DTS task. No: no alerts. |
Step 7: Run a precheck
Click Next: Save Task Settings and Precheck.
To preview the API parameters for this task, hover over Next: Save Task Settings and Precheck and click Preview OpenAPI parameters before proceeding.
DTS runs a precheck before the migration task can start. If the precheck fails, click View Details next to each failed item, fix the issues, then click Precheck Again. For alert items that can be safely ignored, click Confirm Alert Details > Ignore > OK, then click Precheck Again. Ignoring alerts may result in data inconsistency.
Step 8: Purchase the migration instance
Wait for the precheck success rate to reach 100%, then click Next: Purchase Instance.
On the Purchase Instance page, configure the instance class:
| Parameter | Description |
|---|---|
| Resource Group | The resource group for the migration instance. Default: default resource group. See What is Resource Management? |
| Instance Class | The migration throughput class. Select based on your data volume and migration speed requirements. See Specifications of data migration instances. |
Step 9: Start the migration task
Select the Data Transmission Service (Pay-as-you-go) Service Terms check box, then click Buy and Start.
Monitor progress on the Task Management page.
What to do after migration completes
After the migration task reaches 100% progress:
-
Stop the migration task. Stop or release the DTS migration task before or immediately after switching workloads. If you don't, a resumed task may overwrite destination data with source data.
-
Clean up. Revoke write permissions from DTS accounts on the destination database using
REVOKE, or release the DTS instance to stop incurring charges.