This topic describes how to migrate data from a self-managed Oracle database to a PolarDB for MySQL cluster by using Data Transmission Service (DTS). DTS supports schema migration, full data migration, and incremental data migration. When you migrate data from a self-managed Oracle database, you can select all of the supported migration types to ensure service continuity.
Prerequisites
- The version of the self-managed Oracle database is 9i, 10g, 11g, 12c, 18c, or 19c.
- Supplemental logging, including SUPPLEMENTAL_LOG_DATA_PK and SUPPLEMENTAL_LOG_DATA_UI, is enabled for the self-managed Oracle database. For more information, see Supplemental Logging.
- The self-managed 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.
- The available storage space of the PolarDB for MySQL cluster is larger than the total size of the data in the self-managed Oracle database.
Precautions
- DTS uses read and write resources of the source and destination databases during full data migration. This may increase the loads of the database servers. 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 impact of data migration on 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 utilization of the source and destination databases is less than 30%.
- The tables to be migrated in the source database must have PRIMARY KEY or UNIQUE constraints and all fields must be unique. Otherwise, the destination database may contain duplicate data records.
- If the self-managed Oracle database is deployed in a Real Application Cluster (RAC)
architecture and is connected to DTS over an Alibaba Cloud virtual private cloud (VPC),
you must connect the Single Client Access Name (SCAN) IP address of the Oracle RAC
and the virtual IP address (VIP) of each node to the VPC and configure routes. The
settings ensure that your DTS task can run as expected. For more information, see
Configure a route between DTS and Express Connect, VPN Gateway, or Smart Access Gateway.
Notice When you configure the source Oracle database in the DTS console, you can specify the SCAN IP address of the Oracle RAC as the database endpoint or IP address.
- If a data migration task fails, DTS automatically resumes the task. Before you switch your workloads to the destination cluster, stop or release the data migration task. Otherwise, the data in the source database will overwrite the data in the destination cluster after the task is resumed.
- Table names in the PolarDB for MySQL cluster are case-insensitive. If a table name
in the source Oracle database contains uppercase letters, PolarDB for MySQL converts
all uppercase letters to lowercase letters before creating the table.
If the source Oracle database contains identical table names that differ only in capitalization, these table names are identified as duplicate. During schema migration, the following message is returned: "The object already exists." To prevent name conflicts in the destination database, you can rename the migrated objects by using the object name mapping feature. For more information, see Object name mapping.
- DTS automatically creates a destination database in the PolarDB for MySQL cluster. However, if the name of the source database is invalid, you must manually create a database in the PolarDB for MySQL cluster before you configure the data migration task. For more information about how to create a database and the database naming conventions, see Create a database.
Billing
Migration type | Task 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. |
Migration types
- Schema migration
DTS supports schema migration for tables and indexes. DTS does not support schema migration for the following types of objects: view, synonym, trigger, stored procedure, function, package, and user-defined type. DTS has the following limits on schema migration for tables and indexes:
- DTS does not support schema migration for nested tables. DTS converts clustered tables and index-organized tables (IOTs) into common tables in the destination database.
- DTS does not support schema migration for function-based indexes, domain indexes, bitmap indexes, or reverse indexes.
- Full data migration
DTS migrates historical data of the required objects from the self-managed Oracle database to the destination database in the PolarDB for MySQL cluster.
- Incremental data migration
DTS retrieves redo log files from the self-managed Oracle database. Then, DTS synchronizes incremental data from the self-managed Oracle database to the destination database in the PolarDB for MySQL cluster. Incremental data migration allows you to ensure service continuity when you migrate data from the self-managed Oracle database to the destination database.
Data type conversion
Oracle and PolarDB for MySQL are heterogeneous databases. DTS does not ensure that the schemas of the source and destination databases are consistent after schema migration. We recommend that you evaluate the impact of data type conversion on your business. For more information, see Data type mappings between heterogeneous databases.
Before you begin
Log on to the source Oracle database, create an account for data collection, and grant permissions to the account.
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 | The database administrator (DBA) permission |
PolarDB for MySQL cluster | The permissions of the schema owner | The permissions of the schema owner | The permissions of the schema owner |
For more information about how to create and authorize a database account, see the following topics:
- Self-managed Oracle database: CREATE USER and GRANT
- PolarDB for MySQL cluster: Create a database account and Manage database accounts for a cluster
Enable logging and grant fine-grained permissions to an Oracle database account
Procedure
What to do next
The database accounts that are used for data migration have the read and write permissions. After data migration is complete, you must delete the accounts of both the self-managed Oracle database and the PolarDB for MySQL cluster to ensure database security.
More information
DTS supports reverse data transmission when you migrate data from a self-managed Oracle database to a PolarDB for MySQL cluster. You can use this feature to synchronize data changes from the PolarDB for MySQL cluster to the self-managed Oracle database. To do this, submit a ticket.