All Products
Search
Document Center

Data Transmission Service:Migrate data from PolarDB for PostgreSQL to a self-managed Oracle database

Last Updated:Mar 28, 2026

Use Data Transmission Service (DTS) to migrate data from a PolarDB for PostgreSQL cluster to a self-managed Oracle database. DTS supports full data migration and incremental data migration, so you can migrate with zero downtime or perform a one-time full copy.

Prerequisites

Before you begin, make sure that:

  • The self-managed Oracle database is created with enough disk space — the Oracle disk space must exceed the used storage space of the source PolarDB for PostgreSQL cluster

  • The destination schema and tables are created in the Oracle database before you start migration (DTS does not perform schema migration for this source-to-destination pair)

  • The source database account has privileged account permissions. For instructions, see Create a database account

  • The target Oracle database account has schema owner permissions for the destination schema. Grant permissions using Oracle's CREATE USER and GRANT statements

  • (Incremental migration only) The wal_level parameter of the source PolarDB for PostgreSQL cluster is set to logical. For instructions, see Set cluster parameters

  • (Incremental migration only) The PolarDB for PostgreSQL cluster supports and has enabled Logical Replication Slot Failover to prevent logical replication from being interrupted by a primary/secondary switchover

  • (Oracle RAC only) If the self-managed Oracle database is a Real Application Clusters (RAC) database and connects to Alibaba Cloud through a VPC, connect the SCAN IP and the virtual IP address (VIP) of each node to the Alibaba Cloud VPC and configure routes. For instructions, see Overview of solutions for connecting an on-premises data center to Alibaba Cloud and Connect an on-premises data center to DTS through a VPN Gateway

Limitations

Blocking limitations

Address these before starting the migration. Ignoring them may cause the task to fail or become unrecoverable.

  • No schema migration. Create all destination schemas and tables in Oracle before configuring the migration task.

  • Logical Replication Slot Failover required for incremental migration. If the source PolarDB for PostgreSQL cluster does not support Logical Replication Slot Failover (for example, if the cluster's Database Engine is PostgreSQL 14), a high availability (HA) switchover during migration may cause the migration instance to fail and become unrecoverable.

  • 256 MB per-row limit for incremental migration. If a single row exceeds 256 MB after an incremental change, the migration instance fails and cannot be recovered. To resume, reconfigure the migration instance.

  • Primary key or non-null unique index required. Tables to be migrated must have a primary key or a non-null unique index.

  • No DDL operations during full migration. DDL operations that change database or table structure cause the migration task to fail.

  • Foreign keys and triggers in the destination database. Disable foreign keys and triggers in the destination Oracle database before migration. If they remain active, the migration task may fail.

  • REPLICA IDENTITY setting for incremental migration. Before writing data to migrated tables, run the following command in the source database. Run this during off-peak hours and avoid concurrent table lock operations to prevent deadlocks.

    ALTER TABLE schema.table REPLICA IDENTITY FULL;

    Run this command in the following scenarios: when the instance runs for the first time; when the migration object is a schema and a new table is created in the schema; or when the migration object is a schema and an existing table is rebuilt using the RENAME command. If you skip the related precheck item, DTS automatically runs this command during instance initialization.

  • Partitioned tables. Include both the parent table and all child tables as migration objects. In PostgreSQL, parent tables of partitioned tables do not store data directly — all data is in child tables. Omitting child tables causes data inconsistency.

General limitations

  • A migration task migrates only one database. Configure a separate task for each database you want to migrate.

  • DTS does not support migrating TimescaleDB extension tables, tables with cross-schema inheritance, or tables with unique indexes based on expressions.

  • Schemas created by installing plugins cannot be migrated and do not appear in the console when you configure the task.

  • Cascade update and delete operations in the source database may cause data inconsistency in the destination.

  • Because full data migration runs concurrent INSERT operations, the destination table space may be larger than the source after full migration.

  • DTS validates data content but does not validate metadata such as sequences. Validate sequences and other metadata separately.

  • Long-running transactions combined with an incremental migration task cause write-ahead log (WAL) accumulation, which may exhaust disk space on the source database.

Replication slot management

During incremental data migration, DTS creates a replication slot with the prefix dts_sync_ in the source database. This slot holds incremental logs from the last 15 minutes. When migration fails or the migration instance is released, DTS attempts to clean up the slot automatically.

Automatic cleanup fails in the following cases, and you must clean up the slot manually to prevent disk accumulation:

  • The source database account password is changed during migration.

  • The DTS IP address is removed from the source database's IP address whitelist during migration.

  • A failover occurs on the source database — log in to the secondary database to clean up the slot.

DTS temporary tables

DTS creates the following temporary tables in the source database during migration. Do not delete them — deleting them causes the migration task to fail. DTS deletes them automatically when the migration instance is released.

public.dts_pg_class, public.dts_pg_attribute, public.dts_pg_type, public.dts_pg_enum, public.dts_postgres_heartbeat, public.dts_ddl_command, public.dts_args_session, public.aliyun_dts_instance

Billing

Migration typeInstance configuration feeInternet traffic fee
Full data migrationFreeCharged when Access Method of destination is Public IP Address. See Billing overview.
Incremental data migrationCharged. See Billing overview.

SQL operations supported for incremental migration

Operation typeSQL statements
DMLINSERT, UPDATE, DELETE

Migrate data

Step 1: Open the migration task configuration page

Use one of the following entry points.

From the DTS console:

  1. Log on to the Data Transmission Service (DTS) console.

  2. In the left navigation pane, click Data Migration.

  3. In the upper-left corner, select the region where the migration instance will be located.

  4. Click Create Task.

From the DMS console:

The actual navigation may vary based on the DMS console mode and layout. For details, see Simple mode console and Customize the layout and style of the DMS console.
  1. Log on to the Data Management (DMS) console.

  2. In the top menu bar, choose Data + AI > Data Transmission (DTS) > Data Migration.

  3. To the right of Data Migration Tasks, select the destination region.

  4. Click Create Task.

Step 2: Configure source and destination databases

On the task configuration page, set Task Name to a descriptive name for easy identification. The name does not need to be unique.

Source database (PolarDB for PostgreSQL):

ParameterValue
Select Existing ConnectionSelect a previously registered instance, or leave blank to configure manually.
Database TypePolarDB for PostgreSQL
Access MethodAlibaba Cloud Instance
Instance RegionSelect the region of the source PolarDB for PostgreSQL cluster.
Replicate Data Across Alibaba Cloud AccountsSelect No if using an instance under the current Alibaba Cloud account.
Instance IDSelect the ID of the source PolarDB for PostgreSQL cluster.
Database NameEnter the name of the database containing the objects to migrate.
Database AccountEnter the privileged account. See Prerequisites.
Database PasswordEnter the account password.

Destination database (Oracle):

ParameterValue
Select Existing ConnectionSelect a previously registered instance, or leave blank to configure manually.
Database TypeOracle
Access MethodSelect based on the deployment location. This guide uses Self-managed Database on ECS as an example. For other deployment types, see Preparations overview.
Instance RegionSelect the region of the destination Oracle database.
ECS Instance IDSelect the ECS instance hosting the Oracle database.
Port NumberEnter the Oracle service port. Default: 1521.
Oracle TypeSelect Non-RAC Instance (enter SID) or RAC or PDB Instance (enter Service Name). In this example, select RAC or PDB Instance and enter the Service Name.
Database AccountEnter the Oracle account with schema owner permissions.
Database PasswordEnter the account password.

After completing the configuration, click Test Connectivity and Proceed. In the CIDR Blocks of DTS Servers dialog box, click Test Connectivity.

Make sure the DTS server IP address ranges are added to the security settings of both the source and destination databases. See Add DTS server IP addresses to a whitelist.

Step 3: Configure migration objects

On the Configure Objects page, set the following parameters:

ParameterDescription
Migration TypesSelect Full Data Migration for a one-time copy. Select both Full Data Migration and Incremental Data Migration for a zero-downtime migration. If you select only full migration, do not write new data to the source database during migration to maintain data consistency.
Processing Mode of Conflicting TablesPrecheck and Report Errors (default): the precheck fails if a table with the same name exists in the destination. Ignore Errors and Proceed: skips the conflict check. Use with caution — this may overwrite data in the destination or cause migration failures if table schemas differ.
Capitalization of object names in destination instanceSet the case sensitivity policy for migrated object names. Default is DTS default policy. See Case sensitivity of object names in the destination database.
Source ObjectsClick objects in the Source Objects box and move them to Selected Objects using the arrow. You can select schemas or tables.
Selected ObjectsRight-click a migration object to use object name mapping (map to a specific schema, table, or column in the target Oracle database), select SQL operations at the table level, or set filter conditions. See Database, Table, and Column Name Mapping and Set filter conditions.
Note

    Click Next: Advanced Settings.

    Step 4: Configure advanced settings

    ParameterDescription
    Dedicated Cluster for Task SchedulingDTS schedules tasks on a shared cluster by default. For more stable tasks, purchase a dedicated cluster.
    Retry Time for Failed ConnectionsDuration DTS retries after a connection failure. Default: 720 minutes. Set to a value from 10 to 1,440 minutes. Set to more than 30 minutes for production use. During this period, the task is billed.
    Retry Time for Other IssuesDuration DTS retries after non-connectivity errors (DDL or DML exceptions). Default: 10 minutes. Set to a value from 1 to 1,440 minutes. Must be less than Retry Time for Failed Connections.
    Enable Throttling for Full Data MigrationLimit QPS to the source database, RPS of Full Data Migration, and data migration speed (MB/s) to reduce database load. Available only when Full Data Migration is selected. You can also adjust throttling after the task starts.
    Enable Throttling for Incremental Data MigrationLimit RPS of Incremental Data Migration and data migration speed (MB/s). Available only when Incremental Data Migration is selected. You can also adjust throttling after the task starts.
    Environment Tag(Optional) Select a tag to identify the instance.
    Configure ETLSelect Yes to configure the ETL feature and enter data processing statements. Select No to skip ETL.
    Monitoring and AlertingSelect Yes to set an alert threshold and alert notifications for migration failures or latency exceeding the threshold.

    Step 5: Run the precheck

    Click Next: Save Task Settings and Precheck.

    To preview the API parameters for this instance configuration, hover over the Next: Save Task Settings and Precheck button and click Preview OpenAPI parameters.

    DTS runs a precheck before starting the migration. If the precheck fails:

    • Click View Details next to the failed item, fix the issue, then run the precheck again.

    • For warnings that can be ignored, click Confirm Alert Details > Ignore > OK > Precheck Again. Ignoring warnings may cause data inconsistency.

    Step 6: Purchase the instance and start migration

    1. When the Success Rate reaches 100%, click Next: Purchase Instance.

    2. On the Purchase page, select the resource group and instance class. The instance class affects migration speed. See Data migration link specifications.

    3. Read and accept Data Transmission Service (Pay-as-you-go) Service Terms.

    4. Click Buy and Start, then click OK in the confirmation dialog.

    The migration task appears on the Data Migration Tasks list page. Full migration tasks stop automatically when complete (status: Completed). Incremental migration tasks continue running (status: Running) until you stop them.

    Switch your business to the destination database

    For incremental migration, wait until the task's Incremental Data Migration phase shows a latency of 0s, then:

    1. Stop writing data to the source database.

    2. Wait a few minutes for the latency to return to 0s.

    3. Stop the migration task.

    4. Switch your business connections to the destination Oracle database.

    Important

    DTS attempts to automatically recover failed tasks within seven days. Before switching your business to the destination, end or release the migration task, or revoke write permissions for the DTS account on the destination database. This prevents the source data from overwriting destination data if the task recovers automatically.

    DTS technical support will attempt to recover failed tasks within 8 hours. During recovery, DTS may restart the task or adjust task parameters. Only DTS task parameters are modified — database parameters remain unchanged. For modifiable parameters, see Modify instance parameters.

    What's next