When you have completed the assessment and are ready to migrate data from a self-managed Oracle database to a PolarDB for PostgreSQL (Compatible with Oracle) cluster, Data Transmission Service (DTS) is the core tool for this purpose. Direct data migration may cause data inconsistency or even migration failure if compatibility differences between databases (such as sequences, case sensitivity, and character sets) are not handled properly. This document serves as your operation manual. It describes how to configure a DTS task and explains the key limits and precautions during migration in detail, helping you complete a smooth and reliable data migration.
Features
DTS supports migrating your self-managed Oracle database to a PolarDB for PostgreSQL (Compatible with Oracle). It provides three core migration capabilities that you can combine flexibly based on business requirements. We recommend that you configure schema migration, full migration, and incremental migration at the same time to migrate self-managed applications to the cloud without downtime.
Schema migration: Migrates database object definitions in the source database (such as tables, views, stored procedures, and functions) to the target database.
Full migration: Copies all existing data in the source database at the time of migration to the target database in a single operation.
Incremental migration: On the basis of full migration, continuously captures data changes in the source database (
Redo LogandArchive Log) and synchronizes them to the target database in real time. This is the key to smooth migration without service downtime.
Common migration methods
Migration method | Business downtime | Data consistency | Cost | Use cases |
Schema migration | None | / | Free | Only pre-creates the database schema. Suitable for setting up empty development or test environments. |
Schema migration + full migration | Long (you must wait for the full migration to complete) |
| Free | Suitable for relocating non-core services that can tolerate long downtime, or for data initialization in development or test environments. |
Schema migration + full migration + incremental migration | No downtime (no service interruption) | Regardless of whether data is written during migration, data is consistent after the migration is complete (when incremental migration has no latency). | Billed | Online smooth migration of core services. Suitable for production systems that are sensitive to downtime. |
Billing
When you use DTS to migrate a self-managed Oracle database to a PolarDB for PostgreSQL (Compatible with Oracle), schema migration, full migration, and public network traffic are free, and the following items are billed:
Incremental migration: If incremental migration is selected when you configure the migration task, you are billed while incremental migration is running normally (no charge applies during schema migration and full migration, or while incremental migration is paused or fails).
Data validation: If data validation is selected when you configure the migration task, data validation fees may be incurred.
Prerequisites
Before you create a migration task, you must complete the following preparations and checks:
Source self-managed Oracle database version: 9i, 10g, 11g, 12c, 18c, and 19c.
The available storage space of the target PolarDB for PostgreSQL (Compatible with Oracle) cluster must be greater than the used storage space of the self-managed Oracle database.
Precautions
Due to kernel differences between Oracle and PolarDB for PostgreSQL (Compatible with Oracle), you must understand and follow the following limits to avoid data inconsistency or task failure.
Kernel compatibility and data behavior differences:
Sequence values are not synchronized: DTS synchronizes the current sequence values only once during schema migration and does not update them automatically in the incremental phase afterward. As a result, when services are switched over, the new application starts generating IDs from an older sequence value, causing primary key conflicts.
NoteAt the last moment before the service switchover, on the DTS task management page, in the Incremental Write module, click Sync Sequence, and set the Offset. DTS generates sequence synchronization statements and executes the sequence value synchronization.
Character set compatibility: Make sure that the character sets of the source and target databases are compatible; otherwise, garbled characters or task failures may occur. We recommend that the target database use the
UTF8character set.Database and table name case: By default, DTS maps uppercase object names in Oracle to lowercase names in PolarDB. Usually, applications do not need to be modified, but if your code forcibly uses quoted uppercase names, pay attention to compatibility.
CHAR/VARCHAR precision semantics: Pay attention to the difference between the byte precision of Oracle and the character precision of PolarDB. You can set the
polar_default_char_length_semanticsparameter to unify the behavior and avoid data truncation.\0 character handling: PolarDB does not allow
\0(null character) in data. DTS automatically removes this character during migration. If\0is part of a primary key or unique key, this may cause data conflicts and loss (for example,'key\0'and'key'become the same value on the target side).Empty strings ('') and NULL: Oracle treats empty strings as
NULL, whereas in standard SQL the two are different. PolarDB uses thepolar_empty_string_is_null_enableparameter (enabled by default) to be compatible with this behavior. Make sure that this parameter meets your business expectations.Time zone consistency: The time zone settings of the source and target databases must be consistent; otherwise, values of time-type fields will be incorrect.
INTEGER type range: Note that the range of
INTEGER(NUMBER(38)) in Oracle is much larger than the range ofINTEGER(32-bit) in PolarDB, which may cause "out of range" errors. Evaluate and adjust the target database types in advance.
DTS migration operations and process limits:
Source database resource impact: During full migration, some read and write resources (CPU or memory) of the source and target databases are consumed.
Primary key/unique key limits: Tables to be migrated should have a primary key or unique key. For tables without primary keys, DTS cannot guarantee data consistency (duplicate data may occur on the target side).
NoteIf a table to be migrated has neither a primary key nor a unique key, DTS provides the Add a hidden primary key for a table without a primary key/a table without a unique key feature, which uses
ROWIDin Oracle as the hidden primary key (that is, a non-null unique key) of the target table to avoid duplicate data in the target database.DDL limits: During schema migration and full migration, do not perform any DDL operations on the migration objects in the source database (such as changing table schemas). Otherwise, the migration task fails.
Oracle Data Pump limits: During incremental migration, importing data into the source database by using Oracle Data Pump is not supported. Otherwise, incremental data is lost.
External table limits: DTS does not support migrating external tables in Oracle.
Trigger limits: Triggers are not supported for now. During schema migration, triggers are also migrated to the target database, which causes data inconsistency between the source and target databases. We recommend that you delete the triggers in the source database or perform schema migration first and then delete the triggers in the target database.
Foreign keys and cascading operations: During full and incremental migration, DTS temporarily disables constraint checks and foreign key cascading operations on the target database at the session level. If cascading updates or deletes of foreign keys occur in the source database during this period, data inconsistency may occur in the target database.
Stage 1: Preparations
Authorize DTS to access cloud resources
Log on to the Quick authorization page with your Alibaba Cloud account (primary account) and click Confirm Authorization.
After you complete the authorization, if the page displays
EntityAlreadyExists.RoleandEntityAlreadyExists.Role.Policy, the current Alibaba Cloud account has granted DTS the permission to access cloud resources, and you can continue with the subsequent preparations.
Create a database account and grant permissions
When you use DTS for data migration, the source and target database accounts must have the following permissions:
Database | Schema migration | Full migration | Incremental migration |
Self-managed Oracle database | Schema owner permission | Schema owner permission | Fine-grained authorization required |
PolarDB for PostgreSQL (Compatible with Oracle) | Schema owner permission | ||
You can use an existing database account (with the required permissions) to complete the migration task, or create and authorize database accounts for migration in the source and target databases by using the following methods:
Self-managed Oracle account
You must create an account for data collection and grant permissions to it. The account for data collection requires the following permissions:
Task type | Permission option |
Schema and full tasks | DBA role or fine-grained permissions |
Incremental tasks | Fine-grained permissions required |
For incremental tasks from a non-CDB Oracle source, you can also grant the DBA role instead of fine-grained permissions.
Grant the DBA role
-- Create the account and grant permissions
create user rdsdt_dtsacct identified by rdsdt_dtsacct;
grant create session to rdsdt_dtsacct;
grant connect to rdsdt_dtsacct;
grant dba to rdsdt_dtsacct;
-- Verify the permissions
select * from user_tab_privs;
select granted_role from user_role_privs;Fine-grained permissions for schema and full tasks
-- Create the account and grant permissions
create user rdsdt_dtsacct identified by rdsdt_dtsacct;
grant create session to rdsdt_dtsacct;
grant connect to rdsdt_dtsacct;
grant select_catalog_role to rdsdt_dtsacct;
grant select any table to rdsdt_dtsacct;
-- Verify the permissions
select * from user_role_privs;
select * from user_sys_privs;Incremental tasks Fine-grained authorization
Oracle 10g and 11g
-- Create the account and grant permissions
create user rdsdt_dtsacct identified by rdsdt_dtsacct;
grant create session to rdsdt_dtsacct;
grant connect to rdsdt_dtsacct;
grant select_catalog_role to rdsdt_dtsacct;
grant select any table to rdsdt_dtsacct;
grant select any transaction to rdsdt_dtsacct;
grant select on all_objects to rdsdt_dtsacct;
grant select on all_tab_cols to rdsdt_dtsacct;
grant select on dba_registry to rdsdt_dtsacct;
grant execute on sys.dbms_logmnr to rdsdt_dtsacct;
grant select on v_$log to rdsdt_dtsacct;
grant select on v_$logfile to rdsdt_dtsacct;
grant select on v_$standby_log to rdsdt_dtsacct;
-- Grant v_$standby_log if the Oracle database is an ADG secondary database
grant select on v_$archived_log to rdsdt_dtsacct;
grant select on v_$parameter to rdsdt_dtsacct;
grant select on v_$database to rdsdt_dtsacct;
grant select on v_$active_instances to rdsdt_dtsacct;
grant select on v_$instance to rdsdt_dtsacct;
grant select on v_$logmnr_contents to rdsdt_dtsacct;
grant select on sys.USER$ to rdsdt_dtsacct;
grant select on sys.OBJ$ to rdsdt_dtsacct;
grant select on sys.COL$ to rdsdt_dtsacct;
grant select on sys.IND$ to rdsdt_dtsacct;
grant select on sys.ICOL$ to rdsdt_dtsacct;
grant select on sys.CDEF$ to rdsdt_dtsacct;
grant select on sys.CCOL$ to rdsdt_dtsacct;
grant select on sys.TABPART$ to rdsdt_dtsacct;
grant select on sys.TABSUBPART$ to rdsdt_dtsacct;
grant select on sys.TABCOMPART$ to rdsdt_dtsacct;
-- Verify the permissions
select * from user_role_privs;
select * from user_sys_privs;
select * from user_tab_privs;Oracle 12c to 19c (non-CDB)
-- Create the account and grant permissions
create user rdsdt_dtsacct IDENTIFIED BY rdsdt_dtsacct;
grant create session to rdsdt_dtsacct;
grant connect to rdsdt_dtsacct;
grant select_catalog_role to rdsdt_dtsacct;
grant logmining to rdsdt_dtsacct;
grant execute_catalog_role to rdsdt_dtsacct;
grant select any table to rdsdt_dtsacct;
grant select any transaction to rdsdt_dtsacct;
grant select on all_objects to rdsdt_dtsacct;
grant select on all_tab_cols to rdsdt_dtsacct;
grant select on dba_registry to rdsdt_dtsacct;
grant execute on sys.dbms_logmnr to rdsdt_dtsacct;
grant select on v_$log to rdsdt_dtsacct;
grant select on v_$logfile to rdsdt_dtsacct;
grant select on v_$standby_log to rdsdt_dtsacct;
-- Grant v_$standby_log if the Oracle database is an ADG secondary database
grant select on v_$archived_log to rdsdt_dtsacct;
grant select on v_$parameter to rdsdt_dtsacct;
grant select on v_$database to rdsdt_dtsacct;
grant select on v_$active_instances to rdsdt_dtsacct;
grant select on v_$instance to rdsdt_dtsacct;
grant select on v_$logmnr_contents to rdsdt_dtsacct;
grant select on sys.USER$ to rdsdt_dtsacct;
grant select on sys.OBJ$ to rdsdt_dtsacct;
grant select on sys.COL$ to rdsdt_dtsacct;
grant select on sys.IND$ to rdsdt_dtsacct;
grant select on sys.ICOL$ to rdsdt_dtsacct;
grant select on sys.CDEF$ to rdsdt_dtsacct;
grant select on sys.CCOL$ to rdsdt_dtsacct;
grant select on sys.TABPART$ to rdsdt_dtsacct;
grant select on sys.TABSUBPART$ to rdsdt_dtsacct;
grant select on sys.TABCOMPART$ to rdsdt_dtsacct;
-- Verify the permissions
select * from user_role_privs;
select * from user_sys_privs;
select * from user_tab_privs;Oracle 12c to 19c (CDB)
The account name in the pluggable database (PDB) must match the account name in CDB$ROOT, excluding the C## prefix for common users.
-- Step 1: Switch to the PDB, create the account, and grant permissions
alter session set container = ORCLPDB1;
create user rdsdt_dtsacct identified by rdsdt_dtsacct;
grant create session to rdsdt_dtsacct;
grant connect to rdsdt_dtsacct;
grant select_catalog_role to rdsdt_dtsacct;
grant logmining TO rdsdt_dtsacct;
grant execute_catalog_role to rdsdt_dtsacct;
grant select any table to rdsdt_dtsacct;
grant select any transaction to rdsdt_dtsacct;
grant select on all_objects to rdsdt_dtsacct;
grant select on all_tab_cols to rdsdt_dtsacct;
grant select on dba_registry to rdsdt_dtsacct;
grant execute on sys.dbms_logmnr to rdsdt_dtsacct;
grant select on v_$pdbs to rdsdt_dtsacct;
grant select on v_$log to rdsdt_dtsacct;
grant select on v_$logfile to rdsdt_dtsacct;
grant select on v_$standby_log to rdsdt_dtsacct;
-- Grant v_$standby_log if the Oracle database is an ADG secondary database
grant select on v_$archived_log to rdsdt_dtsacct;
grant select on v_$parameter to rdsdt_dtsacct;
grant select on v_$database to rdsdt_dtsacct;
grant select on v_$active_instances to rdsdt_dtsacct;
grant select on v_$instance to rdsdt_dtsacct;
grant select on v_$logmnr_contents to rdsdt_dtsacct;
grant select on sys.USER$ to rdsdt_dtsacct;
grant select on sys.OBJ$ to rdsdt_dtsacct;
grant select on sys.COL$ to rdsdt_dtsacct;
grant select on sys.IND$ to rdsdt_dtsacct;
grant select on sys.ICOL$ to rdsdt_dtsacct;
grant select on sys.CDEF$ to rdsdt_dtsacct;
grant select on sys.CCOL$ to rdsdt_dtsacct;
grant select on sys.TABPART$ to rdsdt_dtsacct;
grant select on sys.TABSUBPART$ to rdsdt_dtsacct;
grant select on sys.TABCOMPART$ to rdsdt_dtsacct;
-- Step 2: Switch to CDB$ROOT and create the CDB-level account
alter session set container = CDB$ROOT;
-- This method requires modifying a default Oracle database parameter
alter session set "_ORACLE_SCRIPT"=true;
create user rdsdt_dtsacct identified by rdsdt_dtsacct;
grant create session to rdsdt_dtsacct;
grant connect to rdsdt_dtsacct;
grant logmining to rdsdt_dtsacct;
grant execute_catalog_role to rdsdt_dtsacct;
grant select on v_$logmnr_contents to rdsdt_dtsacct;
grant execute on sys.dbms_logmnr to rdsdt_dtsacct;
-- Verify the permissions
select * from user_role_privs;
select * from user_sys_privs;
select * from user_tab_privs;PolarDB for PostgreSQL (Compatible with Oracle) Account
We recommend that you use a high-privilege account, which you can create as follows:
Go to the PolarDB console, select the region where the cluster resides in the upper-left corner, and click the target cluster ID.
In the left-side navigation pane, go to the page and click Create Account.
Account Type Select Privileged Account, and set other parameters (such as the account name and password) as required by the console.
Confirm the source database access method and add whitelists
Select an appropriate access method based on the type of the self-managed Oracle database. In addition, if your source or target database instance allows connections only from specific IP addresses, add the IP address ranges of DTS servers to the security settings (firewalls, whitelists, or security groups) of the corresponding databases to allow DTS servers to access them.
Self-managed database type | Recommended access method | Preparations |
Local self-managed database (with a public address) | Public IP Address | You must manually add DTS server IP address whitelists. |
Local self-managed database (without a public address) |
|
|
ECS self-managed database | Self-managed Database on ECS | The system automatically adds the DTS service IP address ranges. |
PolarDB for PostgreSQL (Compatible with Oracle) (target database) instance uses the Cloud Instance access method, and the system automatically adds the DTS service IP address ranges to the RDS instance whitelist without manual configuration.
(Optional) Incremental migration: enable source database archiving and supplemental logging
If you need incremental migration, complete the following configurations on the source database and restart the Oracle database for the configurations to take effect:
Enable archiving mode: The source Oracle database must enable
Archive Log.Enable supplemental logging: Enable
Supplemental Logging. DTS currently supports two modes: database-level supplemental logging and table-level supplemental logging only. You can choose either one based on business requirements.Log retention policy:
Incremental migration: The retention period of
Redo LogandArchive Logmust be at least 24 hours.Full migration + incremental migration: The retention period of
Redo LogandArchive Logmust be at least 7 days.
Enable ARCHIVELOG mode
Check whether ARCHIVELOG mode is already enabled.
The archived log retention period must be at least 3 days.
archive log list;If Database log mode shows Archive Mode, ARCHIVELOG mode is already enabled. Skip to Enable supplemental logging.
Restart the database.
ImportantTo avoid service disruptions, perform this step during off-peak hours.
shutdown immediate; startup mount;Enable ARCHIVELOG mode.
alter database archivelog; alter database open;Verify the configuration.
archive log list;
Enable supplemental logging
DTS supports two supplemental logging modes. Choose based on your requirements:
Mode | Benefit | Limitation |
Database-level | Improves DTS task stability | Uses more disk space |
Table-level | Saves disk space on the source | Tables added via DDL without supplemental logging enabled are not migrated when migration granularity is at the database level |
Enable database-level supplemental logging
Check whether database-level supplemental logging is already enabled.
SELECT supplemental_log_data_min, supplemental_log_data_pk, supplemental_log_data_ui FROM v$database;If the output is as follows, supplemental logging is already enabled and no further steps are needed.
SUPPLEME SUP SUP -------- --- --- IMPLICIT YES YESEnable minimal supplemental logging.
alter database add supplemental log data;Enable supplemental logging for primary keys and unique keys.
alter database add supplemental log data (primary key,unique index) columns;Verify the configuration.
SELECT supplemental_log_data_min, supplemental_log_data_pk, supplemental_log_data_ui FROM v$database;
Enable table-level supplemental logging
Enable minimal supplemental logging.
alter database add supplemental log data;Enable table-level supplemental logging. Choose one of the following based on the table structure: For tables with a primary key: Enable primary key supplemental logging.
alter table <table_name> add supplemental log data (primary key) columns;For tables without a primary key: Enable all-column supplemental logging.
alter table <table_name> add supplemental log data (all) columns;
Specify whether to set an alarm and receive alarm notifications based on business requirements.
Do not set: No alarm is set.
Set: Set an alarm. You also need to set the alarm threshold and alarm notifications. When the migration fails or the latency exceeds the threshold, the system sends an alarm notification.
Stage 2: Configure the migration task
This document uses a local self-managed database (with a public address) as an example to show you how to configure a DTS migration task.
Go to the PolarDB console and choose Oracle Online Migration in the left-side navigation pane.
In the Data Migration step, click Create Migration Task.
Configure source and target database information:
Source database configuration
Configuration item
Description
Database Type
Select Oracle.
Access Method
Select the source database access method confirmed in the preparations. For example, for a local self-managed database (with a public address), the access method is Public IP Address.
Instance Region
Select the region where the source Oracle database resides. If the source database region is not in the available region list, select the nearest one.
Domain Name or IP
Enter the public address or IP address of the source database. If the source database address has a domain name that can be resolved by public DNS, we recommend that you use the domain name.
Port Number
Enter the service port of the source database (which must be open to the Internet). The default value is 1521.
Oracle Type
Select the type of the source Oracle database.
Non-RAC Instance: After you select this option, you also need to enter the SID information.
RAC or PDB Instance: After you select this option, you also need to enter the Service Name information.
Database Account
Enter the account created in the preparations or an existing account that meets the permission requirements.
Database Password
Enter the password for the database account.
Target database configuration
Configuration item
Description
Database Type
Fixed to PolarDB (Compatible with Oracle).
Access Method
Fixed to Alibaba Cloud Instance.
Instance Region
Select the region where the PolarDB for PostgreSQL (Compatible with Oracle) cluster resides.
Instance ID
Select the target PolarDB for PostgreSQL (Compatible with Oracle) cluster ID.
Database Name
Enter the name of the database to which the migration objects belong in the target PolarDB for PostgreSQL (Compatible with Oracle) cluster.
Database Account
Enter the database account of the PolarDB for PostgreSQL (Compatible with Oracle) cluster. We recommend that you use a high-privilege account.
Database Password
Enter the password for the database account.
Test the connection between the source and target databases:
Click Test Connectivity and Proceed at the bottom of the page, and in the CIDR Blocks of DTS Servers dialog box that appears, click Test Connectivity. If the test fails, check the network, account, or permission configuration based on the error message.
Configure task objects:
You need to complete the Configure Objects, Advanced Settings, and Data Verification Settings in sequence.
Object configuration
On the object configuration page, refer to the following table and configure the migration types, databases and tables to be migrated, the case policy of the target database, and the handling mode for existing tables based on your business situation.
Configuration
Description
Migration Types
If you only need full migration, we recommend that you select both Schema Migration and Full Data Migration.
If you need migration without downtime, we recommend that you select Schema Migration, Full Data Migration, and Incremental Data Migration.
NoteIf Schema Migration is not selected, make sure that the database and tables that receive data exist in the target database, and use the database, table, and column name mapping feature in the Selected Objects box as needed.
If Incremental Data Migration is not selected, to ensure data consistency, do not write new data to the source instance during data migration.
Add a hidden primary key for a table without a primary key/a table without a unique key
If the objects to be migrated include tables that have neither a primary key nor a unique key, you must select Yes. DTS uses the ROWID in Oracle as the hidden primary key (non-null unique key) of the target table to avoid duplicate data in the target database.
NoteThis parameter can be configured only when Migration Types is set to Schema Migration, and at least one of Full Data Migration and Incremental Data Migration is selected.
Processing Mode of Conflicting Tables
Precheck and Report Errors: Checks whether a table with the same name exists in the target database. If no table with the same name exists, the check passes. If a table with the same name exists, an error is reported in the precheck phase, and the data migration task is not started.
NoteIf a table with the same name in the target database cannot be deleted or renamed, you can change the table name in the target database. For more information, see Database, table, and column name mapping.
Ignore Errors and Proceed: Skips the check for tables with the same name in the target database.
WarningIf you choose Ignore Errors and Proceed, data inconsistency may occur and bring risks to your business, for example:
If the table schemas are the same and a record in the target database has the same primary key value as a record in the source database:
During full migration, DTS retains the record in the target cluster, that is, the record in the source database is not migrated to the target database.
During incremental migration, DTS does not retain the record in the target cluster, that is, the record in the source database overwrites the record in the target database.
If the table schemas are different, only part of the column data may be migrated or the migration may fail. Proceed with caution.
Source Objects
In the Source Objects box, click the object to be migrated, and then click the
button to move it to the Selected Objects box.Selected Objects
To change the name of a single migration object in the target instance, right-click the migration object in Selected Objects. For the configuration method, see Single database, table, and column name mapping.
To change the names of migration objects in the target instance in batches, click Batch Edit in the upper-right corner of the Selected Objects box. For the configuration method, see Batch database, table, and column name mapping.
NoteIf you use the object name mapping feature, other objects that depend on the object may fail to migrate.
To set WHERE conditions to filter data, right-click the table to be migrated in Selected Objects, and set the filter conditions in the dialog box that appears. For the configuration method, see Set filter conditions.
To select the SQL operations for incremental migration at the database or table level, right-click the object to be migrated in Selected Objects, and select the required SQL operations in the dialog box that appears.
Advanced configuration (optional)
Advanced configuration provides fine-tuning based on a normal DTS migration task (such as the retry time after disconnection, migration rate limits, and monitoring and alarms) and handling of special cases (such as DTS dedicated clusters and configuring ETL for data processing). If you do not need the following advanced configurations, you can keep the default values on this page.
Configuration
Description
Dedicated Cluster for Task Scheduling
By default, DTS schedules tasks on shared clusters, and you do not need to select one. You can purchase a dedicated cluster of a specified specification to run DTS migration tasks. For more information, see What is a DTS dedicated cluster.
Retry Time for Failed Connections
After the migration task starts, if the source or target database fails to connect, DTS reports an error and immediately retries repeatedly. The default retry duration is 720 minutes. You can set a custom retry time within the range of 10 to 1440 minutes; we recommend that you set it to 30 minutes or more. If DTS reconnects to the source and target databases within the specified time, the migration task automatically resumes. Otherwise, the migration task fails.
NoteFor multiple DTS instances with the same source or target, the network retry time of the most recently created task takes effect.
Because DTS charges task running fees during connection retries, we recommend that you set a custom retry time based on your business needs, or release the DTS instance as soon as possible after the source and target database instances are released.
Retry Time for Other Issues
After the migration task starts, if other non-connectivity issues occur on the source or target database (such as DDL or DML execution exceptions), DTS reports an error and immediately retries repeatedly. The default retry duration is 10 minutes. You can set a custom retry time within the range of 1 to 1440 minutes; we recommend that you set it to 10 minutes or more. If the relevant operation succeeds within the specified retry time, the migration task automatically resumes. Otherwise, the migration task fails.
ImportantRetry Time for Other Issues value must be less than the Retry Time for Failed Connections value.
Enable Throttling for Full Data Migration
During full migration, DTS consumes certain read and write resources of the source and target databases, which may increase the database load. You can specify whether to limit the full migration rate based on your actual situation (by setting the Queries per second (QPS) to the source database, RPS of Full Data Migration and Data migration speed for full migration (MB/s)) to relieve the pressure on the target database.
NoteThis configuration item is available only when Migration Types is set to Full Data Migration.
You can also, after the migration instance starts, adjust the full migration rate.
Enable Throttling for Incremental Data Migration
You can also specify whether to limit the incremental migration rate based on your actual situation (by setting the RPS of Incremental Data Migration and Data migration speed for incremental migration (MB/s)) to relieve the pressure on the target database.
NoteThis configuration item is available only when Migration Types is set to Incremental Data Migration.
You can also, after the migration instance starts, adjust the incremental migration rate.
Actual Write Code
You can select the encoding type for writing data to the target side based on your actual situation.
Environment Tag
You can select an environment label to identify the instance based on your actual situation.
Scene Label
You can select an environment label to identify the instance based on your actual situation.
Monitoring and Alerting
Specifies whether to set an alarm. When synchronization fails or the latency exceeds the threshold, the alarm contacts are notified.
No: No alarm is set.
Yes: Set an alarm. You also need to set the alarm threshold and alarm notifications. For more information, see Configure monitoring and alarms during task configuration.
Data validation (optional)
Data validation monitors data differences between the source and target databases. It supports validation while services keep running, helping you identify data and structure inconsistency in a timely manner. To use data validation, you can configure it when you configure the migration task, or configure a separate data validation task after the migration task is complete. If data validation is not required, proceed to the subsequent steps.
Select Data Verification Mode:
NoteFull Data Verification: Validates the data that needs to be validated in full tasks. If the instance does not include incremental tasks, validation starts when the instance is created and full data writing is complete. If the instance includes incremental tasks, validation starts when the instance is created and incremental data writing has no latency for the first time.
Incremental Data Verification: Validates the data of incremental tasks. Validation starts when the instance is created and incremental data writing has no latency for the first time.
Schema Verification (not supported): Performs structure validation on the objects to be validated. If the instance does not include incremental tasks, validation starts when the instance is created and schema and full data writing are complete. If the instance includes incremental tasks, validation starts when the instance is created and incremental data writing has no latency for the first time.
Full validation
If you select Full Data Verification, you also need to set the parameters in the following table.
Parameter
Description
Full Data Verification
Full field validation by row sampling: Configure the sampling percentage to perform full-field validation on the sampled data. The value must be an integer from 10 to 100.
Verify based on the number of table rows: Validates the number of rows of full task data without validating the specific data content.
NoteVerify based on the number of table rows full validation mode is free of charge; Full field validation by row sampling full validation mode is billed based on the actual amount of validated data.
Timeout Settings for Full Data Verification
No: The full validation task is not forcibly terminated on timeout.
Yes: Set the delay time for ending the full validation task. The timer starts when the full validation task starts. If the validation task is not completed within the specified time, it is forcibly ended. The value must be an integer from 1 to 72.
Full calibration reference
Default: Uses the union of the source and target databases as the basis to validate data consistency between the source and target databases.
Source Database: Uses the source database as the basis to validate data consistency between the target and source databases (data that exists only in the target database is not validated).
Destination Database: Uses the target database as the basis to validate data consistency between the source and target databases (data that exists only in the source database is not validated).
Maximum number of rows of data read per second by full verification (RPS)
Full data validation consumes certain read resources of the database. You can limit the rate of the full validation task (the number of data rows and the data volume read per second) based on your actual situation to relieve the pressure on the database.
NoteA value of 0 indicates no limit. When both Maximum number of rows of data read per second by full verification (RPS) and Maximum amount of data read per second by full verification (MBps) are 0, no rate limit is applied.
Maximum amount of data read per second by full verification (MBps)
Incremental validation
If you select Incremental Data Verification, you also need to set the parameters in the following table.
Parameter
Description
Incremental Verification Benchmark
You can filter the DML operations to be validated based on your actual situation. The following operations are supported: Source INSERT Operation, Source UPDATE Operation and Source DELETE Operation.
Set the Verification Objects: All objects are selected by default. You can remove the objects on the right that do not need to be verified..
Configure validation alarms: Based on business requirements, choose to configure the parameters in the following table.
NoteYou can also, after the DTS instance starts, set or modify data validation alarms.
Parameter
Description
Full Data Verification Alert
No: No alarm is set.
Yes: Set an alarm. You also need to select and configure alarm rules. The alarm rules are as follows:
Triggers an alarm when the full validation task fails.
Set the threshold for data inconsistency. An alarm is triggered when the amount of inconsistent data in the full validation task is greater than or equal to the threshold.
Incremental Data Verification Alert
No: No alarm is set.
Yes: Set an alarm. You also need to select and configure alarm rules. The alarm rules are as follows:
Triggers an alarm when the incremental validation task fails.
Set the number of periods, the statistical period, and the threshold for the number of inconsistent records. An alarm is triggered when the number of inconsistent records in the incremental validation task is greater than or equal to the threshold in the specified number of consecutive periods.
Set the number of periods, the statistical period, and the latency threshold. An alarm is triggered when the latency in the incremental validation task is greater than or equal to the threshold in the specified number of consecutive periods.
NoteIf you set validation alarms and need to receive alarm notifications when the validation task triggers an alarm, you also need to subscribe to alarm messages on the CloudMonitor platform. For more information, see Set alarm rules for DTS tasks on the CloudMonitor platform.
Stage 3: Precheck and start
After you complete the configuration in stage 2, click Next: Save Task Settings and Precheck. DTS checks whether the environment, permissions, and configurations of the source and target databases meet the migration requirements. Wait for the precheck to complete.
Success Rate is 100%: The environment is ready, and you can purchase and start the task.
Precheck fails or a non-ignorable warning appears: Click View Details after the failed check item, fix the issue based on the prompt, and run the precheck again.
An ignorable warning appears: Read the warning carefully. After confirming that there is no related risk (such as data inconsistency), you can ignore the warning and run the precheck again.
After the precheck is fully passed, click Next: Purchase Instance.
Select the Resource Group Settings and an appropriate link specification (a higher specification means faster migration).
Read and select Data Transmission Service (Pay-as-you-go) Service Terms, click Buy and Start, and in the OK dialog box that appears, click OK. After you click purchase, the task starts automatically.
Stage 4: Data verification
Wait for the DTS migration task to complete:
Tasks that do not include incremental migration: The task automatically ends after full migration is complete, and the task Status changes to Completed.
Tasks that include incremental migration: The task does not end automatically, and incremental migration continues (the task Status is Running). When incremental migration shows no latency (low latency), the source and target databases are consistent, and you can perform data verification.
Data verification:
When the migration task ends or incremental migration has no latency (low latency), you can verify the data in the source and target databases:
Automatic validation: In DTS, configure a data validation task to automatically compare the data in the source and target databases.
Manual sampling verification: You can manually verify data from multiple dimensions (for example, compare the number of table rows and core business data between the source and target databases) to verify data consistency by sampling. The following is sample code:
-- Example 1: Run on the source and target databases separately to compare table row counts SELECT COUNT(*) FROM your_table; -- Example 2: Run on the source and target databases separately to compare key business metrics, such as the total order amount in a period SELECT SUM(amount) FROM orders WHERE create_time >= DATE '2024-01-01';
Next steps
Test verification: Before the service switchover, you also need to perform comprehensive business function and performance regression testing on the PolarDB test instance and confirm that all functions meet expectations with no compatibility issues.
Migration cutover: After test verification is complete, PolarDB provides two mainstream cutover methods. You can choose one based on your project specifics and requirements for data consistency.
Appendix
SQL operations supported for incremental migration
Operation type | SQL statement |
DML | INSERT, UPDATE, and DELETE |
DDL |
|
Data type mappings between heterogeneous databases
If the range of data to be migrated in Oracle exceeds the range supported by DTS, the precision of the migrated data in PolarDB for PostgreSQL (Compatible with Oracle) is reduced.
Type | Oracle data type | Value range | PolarDB for PostgreSQL (Compatible with Oracle) data type |
Numeric types | NUMBER(p,s) | 1 to 22 bytes. p represents the precision, with a value range of 1 to 38. s represents the scale, with a value range of -84 to 127. | NUMBER(p,s) |
FLOAT(p) | 1 to 22 bytes. p represents the pointer variable, with a value range of 1 to 126 bits. | DOUBLE PRECISION | |
BINARY_FLOAT | 32-bit floating point number, that is, 4 bytes. | REAL | |
BINARY_DOUBLE | 64-bit floating point number, that is, 8 bytes. | DOUBLE PRECISION | |
Date types | DATE | None | DATE |
TIMESTAMP [(fractional_seconds_precision)] | None | TIMESTAMP [(fractional_seconds_precision)] | |
TIMESTAMP [(fractional_seconds_precision)] WITH TIME ZONE | None | TIMESTAMP [(fractional_seconds_precision)] WITH TIME ZONE | |
TIMESTAMP [(fractional_seconds_precision)] WITH LOCAL TIME ZONE | None | TIMESTAMP [(fractional_seconds_precision)] WITH TIME ZONE | |
INTERVAL YEAR [(year_precision)] TO MONTH | None | INTERVAL | |
INTERVAL DAY [(day_precision)] TO SECOND [(fractional_seconds_precision)] | None | INTERVAL | |
String types | CHAR [(size [BYTE | CHAR])] | 2000 bytes. | CHAR [(size [BYTE | CHAR])] |
NCHAR[(size)] | 2000 bytes. | NCHAR[(size)] | |
VARCHAR(size [BYTE | CHAR]) | When MAX_STRING_SIZE = EXTENDED, the maximum length is 32767 bytes. When MAX_STRING_SIZE = STANDARD, the maximum length is 4000 bytes. | VARCHAR(n) | |
VARCHAR2(size [BYTE | CHAR]) | When MAX_STRING_SIZE = EXTENDED, the maximum length is 32767 bytes. When MAX_STRING_SIZE = STANDARD, the maximum length is 4000 bytes. | VARCHAR2(size [BYTE | CHAR]) | |
NVARCHAR2(size) | When MAX_STRING_SIZE = EXTENDED, the maximum length is 32767 bytes. When MAX_STRING_SIZE = STANDARD, the maximum length is 4000 bytes. | NVARCHAR2(size) | |
LONG | The maximum length is 2 GB (2^31-1). | LONG | |
RAW(size) | The maximum length is 32767 bytes or 2000 bytes. | RAW(size) | |
LONG RAW | The maximum length is 2 GB. | LONG RAW | |
CLOB | The maximum length is (4 GB - 1) * DB_BLOCK_SIZE. | CLOB | |
NCLOB | The maximum length is (4 GB - 1) * DB_BLOCK_SIZE. | CLOB | |
BLOB | The maximum length is (4 GB - 1) * DB_BLOCK_SIZE. | BLOB | |
BFILE | 4 GB. | Not supported | |
JSON type | JSON | The maximum length is 32 MB. | JSON |
ROWID type | ROWID | 64 characters. | VARCHAR |
UROWID | 64 characters. | Not supported | |
Spatial types | Custom required | Not supported | |