This topic describes how to migrate data between user-created Oracle databases by using Data Transmission Service (DTS). DTS supports schema migration, full data migration, and incremental data migration. You can select all of the supported migration types to ensure service continuity.
Prerequisites
- The versions of the source and destination Oracle databases are 9i, 10g, 11g, 12c,
18c, or 19c.
Note To ensure compatibility, make sure the versions of the source and destination databases are the same.
- Supplemental logging, including SUPPLEMENTAL_LOG_DATA_PK and SUPPLEMENTAL_LOG_DATA_UI, is enabled for the source Oracle database. For more information, see Supplemental Logging.
- The ARCHIVELOG mode is enabled for the source Oracle database. Archived log files are accessible and a suitable retention period is set for archived log files. For more information, see Managing Archived Redo Log Files.
- The available storage space of the destination Oracle database is larger than the total size of the data in the source Oracle database.
Precautions
- DTS uses read and write resources of the source and destination databases during full data migration. This may increase the database load. If the database performance is unfavorable, the specification is low, or the data volume is large, database services may become unavailable. For example, DTS occupies a large amount of read and write resources in the following cases: a large number of slow SQL queries are performed on the source database, the tables have no primary keys, or a deadlock occurs in the destination database. Before you migrate data, evaluate the performance of the source and destination databases. We recommend that you migrate data during off-peak hours. For example, you can migrate data when the CPU usage of the source and destination databases is less than 30%.
- The source database must have PRIMARY KEY or UNIQUE constraints and all fields must be unique. Otherwise, duplicate data may exist in the destination database.
- DTS automatically resumes a failed data migration task. Before you switch your workloads to the destination database, stop or release the data migration task. Otherwise, the data in the source database will overwrite the data in the destination database after the task is resumed.
Billing
Migration type | Instance configurations | Internet traffic |
---|---|---|
Schema migration and full data migration | Free of charge. | Charged only when data is migrated from Alibaba Cloud over the Internet. For more information, see Pricing. |
Incremental data migration | Charged. For more information, see Pricing. |
Migration types
Migration type | Description |
---|---|
Schema migration | DTS migrates the schemas of the required objects to the destination Oracle database.
DTS supports schema migration for the following types of objects: table, view, synonym,
trigger, stored procedure, function, package, and user-defined type.
Note If an object contains triggers, the data between the source and destination databases
will become inconsistent.
|
Full data migration | DTS migrates historical data of the required objects from the source Oracle database
to the destination Oracle database.
Note During schema migration and full data migration, do not perform DDL operations on
the objects to be migrated. Otherwise, the objects may fail to be migrated.
|
Incremental data migration | After full data migration, DTS retrieves redo log files from the source Oracle database. Then, DTS synchronizes incremental data from the source Oracle database to the destination Oracle database. Incremental data migration allows you to ensure service continuity when you migrate data between Oracle databases. |
SQL operations that can be synchronized during incremental data migration
- INSERT, UPDATE, and DELETE operations
- CREATE TABLE operations
Note The CREATE TABLE operations to create partition tables or tables that contain functions cannot be synchronized.
- ALTER TABLE, DROP TABLE, RENAME TABLE, CREATE INDEX, and ADD INDEX operations
Permissions required for database accounts
Database | Schema migration | Full data migration | Incremental data migration |
---|---|---|---|
Source Oracle database | The owner permission on schemas | The owner permission on schemas | The database administrator (DBA) permission |
Destination Oracle database | The owner permission on schemas | The owner permission on schemas | The owner permission on schemas |
For more information about how to create and authorize an Oracle database account, see CREATE USER and GRANT.
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 pluggable database (PDB) and container database (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
The procedure in this topic uses a user-created database hosted on ECS as an example. You can also follow the procedure to configure data migration tasks for other types of user-created Oracle databases.