This topic describes how to migrate data from an Amazon RDS for Oracle database to an ApsaraDB RDS for MySQL database by using Data Transmission Service (DTS). DTS supports schema migration, full data migration, and incremental data migration. You can select all of the three migration types to migrate data without service interruptions.
Prerequisites
- Public Availability is set to Yes for the Amazon RDS for Oracle database. This ensures that DTS can access the Amazon RDS for Oracle database through the public network.
- The version of the Amazon RDS for Oracle database is 9i, 10g, or 11g.
- The version of the ApsaraDB RDS for MySQL database is 5.6 or 5.7.
- The available storage space of the ApsaraDB RDS for MySQL database is larger than
the total size of the data in the Amazon RDS for Oracle database.
Note The binary log files generated during the migration occupy some space. They are automatically cleared when the migration is complete.
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 uses the
ROUND(COLUMN,PRECISION)
function to retrieve values from columns of the float or double data type. If the precision is not specified, DTS sets the precision for the float data type to 38 digits and the precision for the double data type to 308 digits. You must check whether the precision settings meet your business requirements. - DTS automatically creates a destination database in the ApsaraDB RDS for MySQL instance.
However, if the name of the source database is invalid, you must manually create a
database in the ApsaraDB RDS for MySQL instance before you configure the data migration
task.
Note For more information about how to create a database and the database naming conventions, see Create databases and accounts.
- 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
- Schema migration
DTS supports schema migration of tables, indexes, constraints, and sequences. However, DTS does not support schema migration of views, synonyms, triggers, stored procedures, stored functions, packages, and custom object types.
- Full data migration
DTS migrates full data of objects to be migrated from the Amazon RDS for Oracle database to the database in the ApsaraDB RDS for MySQL instance.
- Incremental data migration
During full data migration, DTS polls and captures the redo log files from the Amazon RDS for Oracle database. After the full data migration is complete, DTS synchronizes incremental data from the Amazon RDS for Oracle database to the destination ApsaraDB RDS for MySQL database. Incremental data migration helps you achieve service continuity when migrating data from an Amazon RDS for Oracle database to the destination database.
SQL operations that can be synchronized during incremental data migration
- INSERT, DELETE, and UPDATE
- CREATE TABLE
Note The operations on tables or partitions that contain computed columns cannot be synchronized.
- ALTER TABLE operations, including ADD COLUMN, DROP COLUMN, RENAME COLUMN, and ADD INDEX
- DROP TABLE
- RENAME TABLE, TRUNCATE TABLE, and CREATE INDEX
Permissions required for database accounts
Database | Schema migration | Full data migration | Incremental data migration |
---|---|---|---|
Amazon RDS for Oracle database | Owner permissions on schemas to be migrated | Owner permissions on schemas to be migrated | Master user permissions |
ApsaraDB RDS for MySQL. | Read and write permissions on the destination database | Read and write permissions on the destination database | Read and write permissions on the destination database |
For more information about how to create a database account and grant permissions to the account, see the following topics:
- CREATE USER and GRANT for an Amazon RDS for Oracle database
- Create accounts and databases for an RDS for MySQL instance
Data type mappings
For more information, see Data type mappings between heterogeneous databases.