You can use DTS to migrate data from an ApsaraDB RDS for PPAS instance to a PolarDB for Oracle cluster. DTS supports schema migration, full data migration, and incremental data migration. By combining these migration types, you can seamlessly migrate your database without interrupting your applications.
Prerequisites
-
You must have an active PolarDB for PostgreSQL (Compatible with Oracle) cluster. For more information, see Create a PolarDB for PostgreSQL (Compatible with Oracle) cluster.
-
Ensure that the PolarDB for PostgreSQL (Compatible with Oracle) cluster has more storage space than the data in the source ApsaraDB RDS for PPAS instance.
-
If database, table, or column names in the source ApsaraDB RDS for PPAS instance contain uppercase letters, you must enclose them in double quotation marks ("") when creating them in the PolarDB for PostgreSQL (Compatible with Oracle) cluster.
-
To perform incremental data migration, you must grant superuser permissions to the database account used for migration on the source ApsaraDB RDS for PPAS instance.
Precautions
-
During a full data migration, DTS consumes read and write resources on the source and destination databases, increasing their load. If your databases have poor performance, low specifications, or high workloads (for example, if the source database has many slow SQL queries or tables without primary keys, or if deadlocks occur in the destination database), the increased load can strain your databases or even cause service interruptions. Perform the data migration during off-peak hours, such as when the CPU utilization of both databases is below 30%.
-
If a source table lacks a primary key or a unique constraint and contains non-unique data, duplicate data may be created in the destination database.
-
A data migration task handles only one database at a time. To migrate multiple databases, create a separate task for each.
-
DTS automatically attempts to resume a failed data migration task. To prevent an automatic resumption from overwriting data in the destination instance, stop or release the task before you perform a business switchover.
- Sequences in the destination database do not continue from the source maximum after switchover. Before switching, query each sequence's maximum value in the source and set it as the starting value in the destination. Query sequence values:
do language plpgsql $$ declare nsp name; rel name; val int8; begin for nsp,rel in select nspname,relname from pg_class t2 , pg_namespace t3 where t2.relnamespace=t3.oid and t2.relkind='S' loop execute format($_$select last_value from %I.%I$_$, nsp, rel) into val; raise notice '%', format($_$select setval('%I.%I'::regclass, %s);$_$, nsp, rel, val+1); end loop; end; $$; -
When migrating data from an ApsaraDB RDS for PPAS instance to a PolarDB for Oracle cluster, follow these recommendations:
-
Ensure the specifications of the PolarDB for Oracle cluster meet or exceed those of the ApsaraDB RDS for PPAS instance. This prevents slow SQL queries or out of memory (OOM) errors caused by insufficient CPU or memory resources post-migration. For recommended PolarDB for Oracle cluster specifications, see Mapping between specifications of ApsaraDB RDS for PPAS instances and recommended specifications of PolarDB for Oracle clusters.
-
If your business requires a specific number of connections or IOPS after migration, refer to and Compute node specifications to select a suitable PolarDB for Oracle cluster.
-
Use the cluster endpoint for your application connections to enable automatic read/write splitting. This routes read requests to read-only nodes and reduces the PolarDB for Oracle cluster load. For details on obtaining a cluster endpoint, see View or apply for an endpoint.
-
-
DTS migrates foreign keys during schema migration.
-
During full and incremental data migration, DTS temporarily disables constraint checks and foreign key cascades at the session level. Cascade updates or deletes on the source database while the task runs may cause data inconsistency.
Operations not allowed on the source database:
Do not run DDL operations that change database or table schemas during schema migration or full migration. Otherwise, the migration task fails.
NoteDuring full migration, DTS queries the source database. This creates metadata locks that may block DDL operations on the source database.
If you run only full migration, do not write new data to the source instance. Otherwise, source and destination data become inconsistent. To keep data consistent in real time, select schema migration, full migration, and incremental migration.
-
If a task fails, DTS support staff will attempt to restore it within eight hours. During restoration, they may restart the task or adjust its parameters.
NoteOnly DTS task parameters are modified—not database parameters. Parameters that may be adjusted include those listed in Modify instance parameters.
Mapping table for RDS PPAS and recommended PolarDB for PostgreSQL (Compatible with Oracle) cluster instance types
We recommend that the specifications of the PolarDB for Oracle cluster be greater than or equal to the RDS PPAS specifications to prevent slow SQL queries or OOM errors caused by insufficient CPU and memory in the PolarDB for Oracle cluster after migration.
|
RDS for PPAS instance types |
Recommended PolarDB for Oracle instance types |
||
|
Instance type |
CPU and memory |
Instance type |
CPU and memory |
|
rds.ppas.t1.small |
1 core, 1 GB |
polar.o.x4.medium |
2 cores, 8 GB |
|
ppas.x4.small.2 |
1 core, 4 GB |
polar.o.x4.medium |
2 cores, 8 GB |
|
ppas.x4.medium.2 |
2 cores, 8 GB |
polar.o.x4.medium |
2 cores, 8 GB |
|
ppas.x8.medium.2 |
2 cores, 16 GB |
polar.o.x4.large |
4 cores, 16 GB |
|
ppas.x4.large.2 |
4 cores, 16 GB |
polar.o.x4.large |
4 cores, 16 GB |
|
ppas.x8.large.2 |
4 cores, 32 GB |
polar.o.x4.xlarge |
8 cores, 32 GB |
|
ppas.x4.xlarge.2 |
8 cores, 32 GB |
polar.o.x4.xlarge |
8 cores, 32 GB |
|
ppas.x8.xlarge.2 |
8 cores, 64 GB |
polar.o.x8.xlarge |
8 cores, 64 GB |
|
ppas.x4.2xlarge.2 |
16 cores, 64 GB |
polar.o.x8.2xlarge |
16 cores, 128 GB |
|
ppas.x8.2xlarge.2 |
16 cores, 128 GB |
polar.o.x8.2xlarge |
16 cores, 128 GB |
|
ppas.x4.4xlarge.2 |
32 cores, 128 GB |
polar.o.x8.4xlarge |
32 cores, 256 GB |
|
ppas.x8.4xlarge.2 |
32 cores, 256 GB |
polar.o.x8.4xlarge |
32 cores, 256 GB |
|
rds.ppas.st.h43 |
60 cores, 470 GB |
polar.o.x8.8xlarge |
64 cores, 512 GB |
Migration types
|
Type |
Description |
|
Schema migration |
DTS migrates the schema definitions of migration objects to the destination PolarDB cluster. Supported objects include tables, views, synonyms, triggers (incompatible), stored procedures, stored functions, packages, and user-defined types. Important
Because triggers are incompatible, migrating objects that contain them can cause data inconsistency. |
|
Full data migration |
DTS migrates all existing data of the migration objects from the source database to the destination PolarDB cluster. Important
Do not perform DDL operations on migration objects until the schema and full data migrations are complete. This can cause the migration to fail. |
|
Incremental data migration |
After the full data migration, DTS polls and captures redo logs from the source database and migrates incremental updates to the destination PolarDB cluster in real time. DTS supports only DML operations (INSERT, UPDATE, and DELETE), not DDL operations. Incremental data migration lets you migrate your database without interrupting applications. |
Billing
|
Migration type |
Task configuration fee |
Internet traffic fee |
|
Schema migration and full data migration |
Free of charge. |
DTS charges an Internet traffic fee when the Access Method of the destination database is set to Public IP Address. Billing overview. |
|
Incremental data migration |
Charged. Billing overview. |
Database account permissions
Log on to the source and destination databases, create accounts for data migration, and grant the required permissions.
|
Database |
Schema migration |
Full data migration |
Incremental data migration |
|
ApsaraDB RDS for PPAS |
Read permission |
Read permission |
superuser permission |
|
PolarDB for Oracle cluster |
Schema ownership |
Schema ownership |
Schema ownership |
To create accounts and grant permissions for a PolarDB for PostgreSQL (Compatible with Oracle) cluster, see Create an account.
Procedure
-
Navigate to the migration task list page for the destination region using one of the following methods.
From the DTS console
-
Log on to the Data Transmission Service (DTS) console.
-
In the navigation pane on the left, click Data Migration.
-
In the upper-left corner of the page, select the region where the migration instance is located.
From the DMS console
NoteThe actual operations may vary based on the mode and layout of the DMS console. For more information, see Simple mode console and Customize the layout and style of the DMS console.
-
Log on to the Data Management (DMS) console.
-
In the top menu bar, choose .
-
To the right of Data Migration Tasks, select the region where the migration instance is located.
-
-
Click Create Task to navigate to the task configuration page.
-
Optional: In the upper-right corner of the page, click New Configuration Page.
Note-
If you are already on the new configuration page (the button in the upper-right corner is Back to Previous Version), you can skip this step.
-
The parameters on the new and old configuration pages are different. We recommend that you use the new configuration page.
-
-
Configure the source and destination databases.
Section
Parameter
Description
N/A
Task Name
DTS automatically generates a task name. We recommend that you specify a descriptive name for easy identification. The name does not need to be unique.
Source Database
Database Type
DTS does not directly support ApsaraDB RDS for PPAS as a source. To configure the migration task, select PostgreSQL.
Connection Type
Select Express Connect, VPN Gateway, or Smart Access Gateway.
Instance Region
Select the region where the source ApsaraDB RDS for PPAS instance is located.
Replicate Data Across Alibaba Cloud Accounts
This example migrates data within the same Alibaba Cloud account. Select No.
The VPC that has been connected to the source database
Select the VPC ID that is connected to the source ApsaraDB RDS for PPAS instance.
IP address
Enter the private IP address of the ApsaraDB RDS for PPAS instance.
Port Number
Enter the port number of the ApsaraDB RDS for PPAS instance. The default is 3433.
Database Account
Enter the database account for the source ApsaraDB RDS for PPAS instance.
Database Password
Enter the password for the specified database account.
Destination Database
Database Type
Select PolarDB (Compatible with Oracle).
Connection Type
Select Alibaba Cloud Instance.
Instance Region
Select the region where the destination PolarDB for Oracle cluster is located.
Instance ID
Select the instance ID of the destination PolarDB for Oracle cluster.
Database Name
Enter the name of the database in the destination PolarDB for Oracle instance to which you want to migrate objects.
Database Account
Enter the database account for the destination PolarDB for Oracle instance. For permission requirements, see Database account permission requirements.
Database Password
Enter the password for the specified database account.
-
After you complete the configuration, click Test Connectivity and Proceed at the bottom of the page.
Note-
Ensure that the IP address segment of the DTS service is automatically or manually added to the security settings of the source and destination databases to allow access from DTS servers. For more information, see Add DTS server IP addresses to a whitelist.
-
If the source or destination database is a self-managed database (the Access Method is not Alibaba Cloud Instance), you must also click Test Connectivity in the CIDR Blocks of DTS Servers dialog box that appears.
-
-
Configure the task objects.
-
On the Configure Objects page, configure the objects that you want to migrate.
Parameter
Description
Migration Types
-
If you only need to perform a full migration, select both Schema Migration and Full Data Migration.
-
To perform a migration with no downtime, select Schema Migration, Full Data Migration, and Incremental Data Migration.
Note-
If you do not select Schema Migration, you must ensure that a database and tables to receive the data exist in the destination database. You can also use the object name mapping feature in the Selected Objects box as needed.
-
If you do not select Incremental Data Migration, do not write new data to the source instance during data migration to ensure data consistency.
Processing Mode of Conflicting Tables
-
Precheck and Report Errors: Checks whether tables with the same names exist in the destination database. If no tables with the same names exist, the precheck is passed. If tables with the same names exist, an error is reported during the precheck, and the data migration task does not start.
NoteIf a table in the destination database has the same name but cannot be easily deleted or renamed, you can change the name of the table in the destination database. For more information, see Object name mapping.
-
Ignore Errors and Proceed: Skips the check for tables with the same names.
WarningSelecting Ignore Errors and Proceed may cause data inconsistency and business risks. For example:
-
If the table schemas are consistent and a record in the destination database has the same primary key value as a record in the source database:
-
During full migration, DTS keeps the record in the destination database. The record from the source database is not migrated.
-
During incremental migration, DTS does not keep the record in the destination database. The record from the source database overwrites the record in the destination database.
-
-
If the table schemas are inconsistent, only some columns of data may be migrated, or the migration may fail. Proceed with caution.
-
Capitalization of Object Names in Destination Instance
You can configure the case sensitivity policy for the names of migrated objects, such as databases, tables, and columns, in the destination instance. By default, DTS default policy is selected. You can also choose to keep the case sensitivity consistent with the default policy of the source or destination database. For more information, see Case sensitivity of object names in the destination database.
Source Objects
In the Source Objects box, click the objects to migrate, and then click
to move them to the Selected Objects box.NoteTime fields support the TIMESTAMP data type. If the value of a time field in the source database is 0, the value in the destination database is automatically converted to null.
Selected Objects
-
To change the name of a single migration object in the destination instance, right-click the object in the Selected Objects box. For more information about how to set the name, see Map a single table or column name.
-
To change the names of multiple migration objects in a batch, click Batch Edit in the upper-right corner of the Selected Objects box. For more information about how to set the names, see Map multiple table or column names in a batch.
NoteIf you use the object name mapping feature, other objects that depend on the mapped object may fail to migrate.
-
-
Click Next: Advanced Settings to configure advanced parameters.
Parameter
Description
Dedicated Cluster for Task Scheduling
By default, DTS schedules tasks on a shared cluster. You do not need to select one. If you want more stable tasks, you can purchase a dedicated cluster to run DTS migration tasks.
Retry Time for Failed Connections
After the migration task starts, if the connection to the source or destination database fails, DTS reports an error and immediately begins to retry the connection. The default retry duration is 720 minutes. You can customize the retry time to a value from 10 to 1440 minutes. We recommend that you set the duration to more than 30 minutes. If DTS reconnects to the source and destination databases within the specified duration, the migration task automatically resumes. Otherwise, the task fails.
Note-
For multiple DTS instances that share the same source or destination, the network retry time is determined by the setting of the last created task.
-
Because you are charged for the task during the connection retry period, we recommend that you customize the retry time based on your business needs, or release the DTS instance as soon as possible after the source and destination database instances are released.
Retry Time for Other Issues
After the migration task starts, if a non-connectivity issue, such as a DDL or DML execution exception, occurs in the source or destination database, DTS reports an error and immediately begins to retry the operation. The default retry duration is 10 minutes. You can customize the retry time to a value from 1 to 1440 minutes. We recommend that you set the duration to more than 10 minutes. If the related operations succeed within the specified retry duration, the migration task automatically resumes. Otherwise, the task fails.
ImportantThe value of Retry Time for Other Issues must be less than the value of Retry Time for Failed Connections.
Enable Throttling for Full Data Migration
During full migration, DTS consumes read and write resources on the source and destination databases, which may increase the database load. If required, you can enable throttling for the full migration task. You can set Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s) to reduce the load on the destination database.
Note-
This configuration item is available only if you select Full Data Migration for Migration Types.
-
You can also adjust the full migration speed after the migration instance is running.
Enable Throttling for Incremental Data Migration
If required, you can also choose to set speed limits for the incremental migration task. You can set RPS of Incremental Data Migration and Data migration speed for incremental migration (MB/s) to reduce the load on the destination database.
Note-
This configuration item is available only if you select Incremental Data Migration for Migration Types.
-
You can also adjust the incremental migration speed after the migration instance is running.
Environment Tag
You can select an environment tag for the instance. This example does not require a selection.
Configure ETL
Choose whether to enable the extract, transform, and load (ETL) feature. For more information, see What is ETL? Valid values:
-
Yes: Enables the ETL feature. Enter data processing statements in the code editor. For more information, see Configure ETL in a data migration or data synchronization task.
-
No: Disables the ETL feature.
Monitoring and Alerting
Select whether to set alerts and receive alert notifications based on your business needs.
-
No: Does not set an alert.
-
Yes: Configure alerts by setting an alert threshold and an alert notifications. If a migration fails or the latency exceeds the threshold, the system sends an alert notification.
-
-
-
Save the task and run a precheck.
-
To view the parameters for configuring this instance when you call the API operation, move the pointer over the Next: Save Task Settings and Precheck button and click Preview OpenAPI parameters in the bubble that appears.
-
If you do not need to view or have finished viewing the API parameters, click Next: Save Task Settings and Precheck at the bottom of the page.
Note-
Before the migration task starts, DTS performs a precheck. The task starts only after it passes the precheck.
-
If the precheck fails, click View Details next to the failed check item, fix the issue based on the prompt, and then run the precheck again.
-
If a warning is reported during the precheck:
-
For check items that cannot be ignored, click View Details next to the failed item, fix the issue based on the prompt, and then run the precheck again.
-
For check items that can be ignored, you can click Confirm Alert Details, Ignore, OK, and Precheck Again to skip the alert item and run the precheck again. If you choose to ignore a warning, it may cause issues such as data inconsistency and pose risks to your business.
-
-
-
Purchase the instance.
-
When the Success Rate is 100%, click Next: Purchase Instance.
-
On the Purchase page, select the link specification for the data migration instance. For more information, see the following table.
Category
Parameter
Description
New Instance Class
Resource Group Settings
Select the resource group to which the instance belongs. The default value is default resource group. For more information, see What is Resource Management?
Instance Class
DTS provides migration specifications with different performance levels. The link specification affects the migration speed. You can select a specification based on your business scenario. For more information, see Data migration link specifications.
-
After the configuration is complete, read and select Data Transmission Service (Pay-as-you-go) Service Terms.
-
Click Buy and Start. In the OK dialog box that appears, click OK.
You can view the progress of the migration task on the Data Migration Tasks list page.
Note-
If the migration task does not include incremental migration, it stops automatically after the full migration is complete. After the task stops, its Status changes to Completed.
-
If the migration task includes incremental migration, it does not stop automatically. The incremental migration task continues to run. While the incremental migration task is running, the Status of the task is Running.
-
-