This topic describes how to migrate data from a user-created Oracle database to a PolarDB for Oracle cluster by using Data Transmission Service (DTS).

Prerequisites

The schema of the source Oracle database is migrated to the destination PolarDB for Oracle cluster by using Advanced Database & Application Migration (ADAM). For more information, see Step 1 to 4 in Migrate the schema of a self-managed Oracle database to a PolarDB for Oracle cluster.

Billing

You are billed when incremental data migration is in progress, including the period when incremental data migration is paused. For more information, see Pricing.

Precautions

During full data migration, DTS uses read and write resources of the source and destination databases. This may increase the loads of the database servers. Before you migrate data, evaluate the impact of data migration on the performance of the source and destination databases. We recommend that you migrate data during off-peak hours.

Before you begin

Log on to the source Oracle database, create an account for data collection, and grant permissions to the account.

Note If you have created a database account and the account has the permissions that are listed in the following table, skip this step.
Database Schema migration Full data migration Incremental data migration
Self-managed Oracle database The permissions of the schema owner The permissions of the schema owner Database administrator (DBA)
PolarDB cluster The permissions of the schema owner The permissions of the schema owner The permissions of the schema owner
Notice If you need to migrate incremental data from an Oracle database but the DBA permission cannot be granted to the database account, you can grant fine-grained permissions to the account. The following sample statements show you how to grant specific permissions to an Oracle database account.
create session;
connect;
resource;
execute on sys.dbms_logmnr;
select on v_$logmnr_contents;
select on v_$log;
select on v_$logfile;
select on v_$archived_log;
select on v_$logmnr_logs;
select on v_$parameter;
select on v_$database;
select on all_objects;
select on all_tab_cols;
select on dba_registry;
select any table;
select any transaction;
select on v$active_instances;
select on v$instance;
select on sys.USER$;
select on SYS.OBJ$;
select on SYS.COL$;
select on SYS.IND$;
select on SYS.ICOL$;
select on SYS.CDEF$;
select on SYS.CCOL$;
select on SYS.TABPART$;
select on SYS.TABSUBPART$;
select on SYS.TABCOMPART$;
select on gv_$listener_network;
#Grant permissions on the pluggable database (PDB) and container database (CDB).
#Grant permissions on the PDB:
create   session;
connect;
resource;
select on  all_objects;
select on  all_tab_cols;
select on  dba_registry;
select any table;
select any transaction;
select on v_$log;
select on v_$logfile;
select on v_$archived_log;
select on v_$parameter;
select on v_$database;
select on v_$active_instances;
select on v_$instance;
select on V_$PDBS;
select on sys.USER$;
select on SYS.OBJ$;
select on SYS.COL$;
select on SYS.IND$;
select on SYS.ICOL$;
select on SYS.CDEF$;
select on SYS.CCOL$;
select on SYS.TABPART$;
select on SYS.TABSUBPART$;
select on SYS.TABCOMPART$;

#Grant permissions on the CDB:
create   session;
LOGMINING;
select on v_$logmnr_contents;

#The following sample statements show you how to grant permissions to a database account named dtstest.
create user dtstest IDENTIFIED BY rdsdt_dtsacct;
grant create session to dtstest;
grant connect to dtstest;
grant resource to dtstest;
grant execute on sys.dbms_logmnr to dtstest;
grant select on v_$logmnr_contents to dtstest;
grant select on v_$log to dtstest;
grant select on v_$logfile to dtstest;
grant select on v_$archived_log to dtstest;
grant select on v_$logmnr_logs to dtstest;
grant select on v_$parameter to dtstest;
grant select on v_$database to dtstest;
grant select on all_objects to dtstest;
grant select on all_tab_cols to dtstest;
grant select on dba_registry to dtstest;
grant select any table to dtstest;
grant select any transaction to dtstest;
grant select on v$active_instances to dtstest;
grant select on v$instance to dtstest;
grant select on sys.USER$ to dtstest;
grant select on SYS.OBJ$ to dtstest;
grant select on SYS.COL$ to dtstest;
grant select on SYS.IND$ to dtstest;
grant select on SYS.ICOL$ to dtstest;
grant select on SYS.CDEF$ to dtstest;
grant select on SYS.CCOL$ to dtstest;
grant select on SYS.TABPART$ to dtstest;
grant select on SYS.TABSUBPART$ to dtstest;
grant select on SYS.TABCOMPART$ to dtstest;
grant select on gv_$listener_network to dtstest;
#The following sample statements show you how to grant permissions on the PDB and CDB to a database account named dtstest.
#Grant permissions on the PDB:
create user dtstest IDENTIFIED BY rdsdt_dtsacct;
grant create  session to dtstest;
grant connect  to dtstest;
grant resource to dtstest;
grant select on  all_objects to dtstest;
grant select on  all_tab_cols to dtstest;
grant select on  dba_registry to dtstest;
grant select any table to dtstest;
grant select any transaction to dtstest;
-- v$log privileges
grant select on v_$log to dtstest;
-- v$logfile privileges
grant select on v_$logfile to dtstest;
-- v$archived_log privileges
grant select on v_$archived_log to dtstest;
-- v$parameter privileges
grant select on v_$parameter to dtstest;
-- v$database privileges
grant select on v_$database to dtstest;
-- v$active_instances privileges
grant select on v_$active_instances to dtstest;
-- v$instance privileges
grant select on v_$instance to dtstest;
-- V$PDBS privileges
grant select on V_$PDBS to dtstest;
grant select on sys.USER$ to dtstest;
grant select on SYS.OBJ$ to dtstest;
grant select on SYS.COL$ to dtstest;
grant select on SYS.IND$ to dtstest;
grant select on SYS.ICOL$ to dtstest;
grant select on SYS.CDEF$ to dtstest;
grant select on SYS.CCOL$ to dtstest;
grant select on SYS.TABPART$ to dtstest;
grant select on SYS.TABSUBPART$ to dtstest;
grant select on SYS.TABCOMPART$ to dtstest;

#Grant permissions on the CDB:
create user dtstest IDENTIFIED BY rdsdt_dtsacct;
grant create   session to dtstest;
grant LOGMINING TO dtstest;
-- v$logmnr_contents privileges
grant select on v_$logmnr_contents to dtstest;

Procedure

  1. Log on to the DTS console. In the left-side navigation pane, click Data Migration.
  2. At the top of the Migration Tasks page, select the region where the destination cluster resides.
  3. In the upper-right corner of the page, click Create Migration Task.
  4. Configure the source and destination databases.
    Configure the source and destination databases
    Section Parameter Description
    N/A Task Name DTS automatically generates a task name. We recommend that you specify an informative name for easy identification. You do not need to use a unique task name.
    Source Database Instance Type Select an instance type based on the deployment of the source database. In this example, select User-Created Database with Public IP Address.
    Note If you select other instance types, you must deploy the network environment for the source database. For more information, see Preparation overview.
    Instance Region If the instance type is set to User-Created Database with Public IP Address, you do not need to specify the instance region.
    Note If a whitelist is configured for the user-created Oracle database, you must add the CIDR blocks of DTS servers to the whitelist of the database. You can click Get IP Address Segment of DTS next to Instance Region to obtain the CIDR blocks of DTS servers.
    Database Type Select Oracle.
    Hostname or IP Address Enter the endpoint that is used to connect to the user-created Oracle database.
    Port Number Enter the service port number of the user-created Oracle database. The default port number is 1521.
    Note The service port of the user-created Oracle database must be accessible over the Internet.
    Instance Type
    • Non-RAC Instance: If you select this option, you must specify the SID.
    • RAC Instance: If you select this option, you must specify the Service Name.
    Database Account Enter the account of the user-created Oracle database. For more information about the permissions that are required for the account, see Before you begin.
    Database Password Enter the password of the source database account.
    Note After you specify the information about the self-managed Oracle database, you can click Test Connectivity next to Database Password to check whether the information is valid. If the information is valid, the Passed message appears. If the Failed message appears, click Check next to Failed. Then, modify the information based on the check results.
    Destination Database Instance Type Select PolarDB.
    Instance Region Select the region where the destination PolarDB for Oracle cluster resides.
    PolarDB Instance ID Select the ID of the destination PolarDB for Oracle cluster.
    Database Name Enter the name of the destination database.
    Database Account Enter the database account of the destination PolarDB for Oracle cluster. For more information about the permissions that are required for the account, see Before you begin.
    Database Password Enter the password of the destination database account.
    Note After you specify the information about the RDS instance, you can click Test Connectivity next to Database Password to check whether the information is valid. If the information is valid, the Passed message appears. If the Failed message appears, click Check next to Failed. Then, modify the information based on the check results.
  5. In the lower-right corner of the page, click Set Whitelist and Next.
    Note DTS adds the CIDR blocks of DTS servers to the whitelist of the destination PolarDB cluster. This ensures that DTS servers can connect to the destination PolarDB cluster.
  6. Select the migration types and the objects to be migrated.
    Select the migration types and the objects to be migrated.
    Setting Description
    Select the migration types Schema migration is completed in Migrate the schema of a self-managed Oracle database to a PolarDB for Oracle cluster. Therefore, you do not need to select Schema Migration in this step.
    • To perform only full data migration, select only Full Data Migration.
    • To ensure service continuity during data migration, select Full Data Migration and Incremental Data Migration.
    Note
    • If Incremental Data Migration is not selected, do not write data to the user-created Oracle database during full data migration. This ensures data consistency between the source and destination databases.
    • The following SQL operations can be synchronized during incremental data migration: INSERT, UPDATE, and DELETE.
    Select the objects to be migrated Select objects from the Available section and click the Right arrow icon to move the objects to the Selected section. The schema of the objects has been migrated to the destination PolarDB for Oracle cluster by using ADAM.
    Warning We recommend that you do not use the object name mapping feature. Otherwise, the data migration task fails.
  7. Perform a precheck and start the data migration task.
    1. In the lower-right corner of the page, click Precheck.
      Note
      • Before you can start the data migration task, a precheck is performed. You can start the data migration task only after the task passes the precheck.
      • If the task fails to pass the precheck, you can click the Info icon icon next to each failed item to view details.
        • You can troubleshoot the issues based on the causes and run a precheck again.
        • If you do not need to troubleshoot the issues, you can ignore failed items and run a precheck again.
    2. After the task passes the precheck, click Next.
    3. In the Confirm Settings dialog box, specify the Channel Specification parameter and select Data Transmission Service (Pay-As-You-Go) Service Terms.
    4. Click Buy and Start to start the data migration task.
  8. After data migration is completed, stop the data migration task.
    Warning To minimize the negative impact of data migration on your business, we recommend that you switch your workloads to the destination PolarDB for Oracle cluster and prepare a rollback solution. You can migrate incremental data from the destination PolarDB for Oracle cluster back to the source Oracle database in real time. For more information, see Switch workloads to the destination database. If you do not need to switch your workloads, perform the following steps to stop the data migration task.
    • Full data migration

      Do not manually stop a task during full data migration. Otherwise, the system may fail to migrate all data. Wait until the migration task automatically ends.

    • Incremental data migration

      The task does not automatically end during incremental data migration. You must manually stop the migration task.

      1. Wait until the task progress bar shows Incremental Data Migration and The migration task is not delayed. Then, stop writing data to the source database for a few minutes. In some cases, the progress bar shows the delay time of incremental data migration.
      2. After the status of incremental data migration changes to The migration task is not delayed, manually stop the migration task.Stop a task during incremental migration