This topic describes how to migrate data from a user-created Oracle database to an AnalyticDB for PostgreSQL instance by using Data Transmission Service (DTS).
Prerequisites
- An Oracle database of version 9i, 10g, 11g, 12c, 18c, or 19c is created.
- The user-created Oracle database is running in ARCHIVELOG mode. 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.
- Supplemental logging, including SUPPLEMENTAL_LOG_DATA_PK and SUPPLEMENTAL_LOG_DATA_UI, is enabled for the user-created Oracle database. For more information, see Supplemental Logging.
- An AnalyticDB for PostgreSQL instance is created in the china (Shanghai), China (Beijing), or China (Shenzhen) region. For more information, see Create an instance.
Billing
Migration type | Instance configuration fee | Internet traffic fee |
---|---|---|
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. |
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.
- If a data migration task fails, DTS automatically resumes the task. Before you switch your workloads to the destination database, stop or release the data migration task. Otherwise, the data from the source database will overwrite the data in the destination database after the task is resumed.
Migration types
Migration type | Description |
---|---|
Schema migration | DTS migrates the schemas of the required objects from the source database to the destination
database. DTS supports schema migration for the following types of objects: table,
index, constraint, function, sequence, and view.
Warning
|
Full data migration | DTS migrates historical data of the required objects from the source database to the
destination database.
Note During schema migration and full data migration, do not perform data definition language
(DDL) operations on the required objects. Otherwise, the objects may fail to be migrated.
|
Incremental data migration | After full data migration is complete, DTS retrieves redo log files from the source
Oracle database. Then, DTS migrates incremental data from the source Oracle database
to the destination database in real time.
DTS can synchronize the following SQL operations during incremental data migration:
Incremental data migration allows you to ensure service continuity when you migrate data from an Oracle database to an AnalyticDB for PostgreSQL instance. |
Permissions required for database accounts
Database | Schema migration | Full data migration | Incremental data migration |
---|---|---|---|
User-created Oracle database | The owner permission on schemas | The owner permission on schemas | DBA |
AnalyticDB for PostgreSQL | The read and write permissions on the destination database | The read and write permissions on the destination database | The read and write permissions on the destination database |
For more information about how to create and authorize a database account, see the following topics:
- User-created Oracle database: CREATE USER and GRANT
- AnalyticDB for PostgreSQL: Configure an 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 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;