This topic describes how to use OceanBase Migration Service (OMS) to migrate data from an Oracle database to OceanBase Database in Oracle compatible mode, including physical data sources, public cloud data sources, and standalone data sources.
Background information
You can create a data migration task in the OMS console to seamlessly migrate the existing business data and incremental data from an Oracle database to OceanBase Database in Oracle compatible mode through schema migration, full migration, and incremental data synchronization.
Oracle databases support single-primary database, single-standby database, and primary-standby database modes. When migrating data from an Oracle database to a database in OceanBase Database's Oracle compatible mode, the operations supported by different types of data sources also vary.
Type |
Supported operations |
|---|---|
| Single Primary Database | Schema migration + Full data migration + Incremental synchronization + Reverse incremental migration |
| Primary/Standby Database | Schema migration + Full migration + Incremental synchronization |
| Primary/Standby Database | Primary database: Supports reverse incremental migration. Standby database: Supports schema migration, full migration, and incremental synchronization. |
Prerequisites
You have created the corresponding schema in the target OceanBase Database in Oracle compatible mode.
Archive logging must be enabled for the Oracle source instance, and the log file must have been switched before the OMS incremental replication.
The LogMiner tool must be installed and available for use on the Oracle source instance.
You can use the LogMiner tool to obtain the specific content within Oracle archive log files.
You have created a dedicated database user for the data migration task in both the source Oracle database and the target OceanBase Database in Oracle compatible mode and granted them the relevant privileges. For details, see Create a database user.
Confirm that supplementary logging at the database level or table level is enabled for the Oracle instance. For details, see Supplementary logging in Oracle databases.
Clock synchronization is required between the Oracle machine and the OMS machine (for example, configure the NTP service). Otherwise, there may be data risks. If it is an Oracle RAC, clock synchronization is also required between multiple Oracle instances.
Limitations
Limitations on the source database
Do not perform DDL operations that modify database or table structures during schema migration or full migration. Otherwise, the data migration task may be interrupted.
OMS supports Oracle Database versions 10G, 11G, 12C, 18C, and 19C. Versions 12C and later include Container Database (CDB) and Pluggable Database (PDB).
OMS only supports migrating objects whose database, table, and column names are ASCII-compliant and do not contain special characters (including line breaks, spaces, and
.|"'`()=;/&\).OMS does not support triggers in the target. If triggers exist, data migration may fail.
OMS does not support migrating index-organized tables (IOTs) in Oracle databases. Otherwise, the data migration task may be interrupted.
Data type limitations
Incremental data migration is not supported if all columns in a table are of LOB type (BLOB/CLOB/NCLOB) or GIS type.
For tables without a primary key that contain LOB and GIS fields, data quality issues may occur during reverse incremental migration.
Data source identifiers and user accounts must be globally unique within the OMS system.
Oracle Database incremental log parsing supports up to 5 TB per day.
Oracle Database versions 11G and earlier do not support creating database objects exceeding 30 bytes. During the reverse incremental step, be careful not to create database objects larger than this limit in OceanBase Database's Oracle compatible mode.
OMS does not support migrating database objects in Oracle Database 12c and later versions that exceed 30 bytes (including schemas, tables, and columns). If you need to migrate database objects larger than 30 bytes, see How to migrate Oracle database objects larger than 30 bytes.
OMS does not support the migration scenario where Oracle materialized views and physical table objects have the same name. If such objects exist, OMS will filter them out by default.
OMS does not support executing certain
UPDATEcommands in the source Oracle database. The following example shows an unsupportedUPDATEcommand.UPDATE TABLE_NAME SET KEY=KEY+1;In the example above,
TABLE_NAMEis the table name, andKEYis a column of type NUMERIC defined as the primary key.
Considerations
When the source Oracle database is in single-standby or primary-standby mode, if the number of running instances differs between the primary and standby databases, some incremental logs may not be fetched. You need to manually set parameters for the Store component to specify which instances' incremental logs should be fetched when incremental data is pulled from the standby database. The procedure is as follows:
Stop the Store component immediately after it starts.
On the Update Configuration page of the Store component, add the
deliver2store.logminer.instance_threadsparameter to specify which instances' logs to fetch.Separate multiple threads with |. For example, 1|2|3. For details on updating the component, see Loss of archive logs during incremental synchronization from an Oracle standby database using OMS.
After setting the parameters, restart the Store component.
Five minutes later, run
grep 'log entries from' connector/connector.logto view which instances' logs were fetched (the thread field indicates which instance's logs were fetched).
When performing incremental synchronization from an Oracle database, it is recommended that the size of a single Oracle database archive file be less than 2 GB. A single archive file that is too large poses the following risks:
The larger a single archive file, the more non-linear the increase in fetch time.
When the source Oracle database is in single-standby or primary-standby mode, incremental data is pulled from the standby database, which can only fetch archive files. Archive files can only be fetched after they are generated. A larger archive file means a longer delay before it can be processed, and it also takes longer to process.
The larger a single archive file, the more memory the Store component requires when pulling with the same concurrency.
Oracle database archive files must be retained for more than 2 days. Otherwise, if the volume of archives suddenly increases during a period or if Oracle Store encounters an exception, there will be no archive files available for recovery when you attempt to restore, making recovery impossible.
If the source Oracle database contains DML statements that exchange primary keys, this will cause OMS to parse logs incorrectly, leading to data loss during migration to the target. An example of a DML statement that exchanges primary keys is as follows:
UPDATE test SET c1=(CASE WHEN c1=1 THEN 2 WHEN c1=2 THEN 1 END) WHERE c1 IN (1,2);The character set configuration for an Oracle instance can be AL32UTF8, AL16UTF16, ZHS16GBK, or GB18030. If the source character set is UTF-8, it is recommended to use a character set compatible with the source at the target (for example, UTF-8, UTF-16, etc.) to avoid issues such as garbled characters at the target due to character set incompatibility.
When OMS pulls incremental data from an Oracle standby database, if the selected migration type includes both incremental synchronization and reverse incremental, and an error occurs during incremental data fetching, you can try executing
ALTER SYSTEM SWITCH LOGFILEon the primary database to get OMS working properly.When migrating data from an Oracle database to OceanBase Database in Oracle compatible mode, prohibit all operations that could cause ROWID changes, such as importing/exporting tables, Alter Table, FlashBack Table, or partition splitting/merging.
If the source Oracle database performs operations that affect RowID behavior, such as updating the partitioning key or merging partitions, the hidden column dependency on RowID introduced in OceanBase Database's Oracle compatible mode may pose a risk of data loss.
Clock desynchronization between nodes, or between the client and the server, can lead to inaccurate latency measurements (for incremental synchronization/reverse incremental).
For example, if a clock is ahead of standard time, the latency may appear negative. If a clock is behind standard time, it may show a positive latency.
Due to China's past implementation of daylight saving time, during incremental synchronization from an Oracle database to OceanBase Database in Oracle compatible mode, there may be a one-hour time difference between the source and target for the start and end dates of daylight saving time from 1986 to 1991, and for the period from April 10 to April 17, 1988, for the
TIMESTAMP(6) WITH TIME ZONEtype.During reverse incremental from an Oracle database to OceanBase Database in Oracle compatible mode, if the source OceanBase Database in Oracle compatible mode is a version earlier than V3.2.x and the table has a global unique index, updating the value of the table's partitioning key may result in data loss during migration.
If the target OceanBase Database in Oracle compatible mode version is less than V2.2.70, switching processes may encounter compatibility risks with objects such as foreign keys and checks.
If you modify a unique index at the target without enabling DDL synchronization, you need to restart the incremental synchronization component; otherwise, data inconsistency may occur.
If forward switchover is not enabled for the data migration task, delete the corresponding unique index and pseudo-column in the target database. Failing to delete these will prevent data writes and, when importing data downstream, the pseudo-column will be regenerated, potentially conflicting with the pseudo-column in the source database.
If forward switchover is enabled for the data migration task, OMS automatically drops hidden columns and unique indexes based on the task type. For more information, see Hidden column mechanism in data migration service.
For incremental synchronization from an Oracle database to an OceanBase Database in Oracle compatible mode, if a new table without a primary key is migrated, OMS does not automatically drop the hidden columns and unique indexes added at the target in OceanBase Database in Oracle compatible mode. Before performing reverse migration, you must manually delete them.
You can check the
logs/msg/manual_table.logfile to confirm the tables without primary keys added during the incremental synchronization phase.When the character encoding configurations at the source and target are different, schema migration provides strategies for expanding field length definitions. For example, length can be expanded by 1.5 times, or the unit can be changed from BYTE to CHAR.
After conversion, data from different character sets at the source can be successfully migrated to the target. However, after cutover, reverse incremental migration may fail due to data being too long to write back to the source.
If the source contains data types with time zone information (for example, TIMESTAMP WITH TIME ZONE), ensure the target database supports the source's corresponding time zone; otherwise, data inconsistency may occur during migration.
In database/table consolidation scenarios:
It is recommended to use matching rules to map the relationship between the source and target.
It is recommended to create the table structure at the target manually. If using OMS to create it, skip failed objects during the schema migration step.
Check the objects in the Oracle database recycle bin. When the number of objects exceeds 100, internal table queries may time out. Please clean up the recycle bin objects.
Check if the recycle bin is enabled.
SELECT Value FROM V$ob_parameters WHERE Name = 'recyclebin';Check the number of objects in the recycle bin.
SELECT COUNT(*) FROM USER_RECYCLEBIN;
If you configure only Incremental Synchronization when creating the data migration task, OMS requires that the source database's archive logs be retained for more than 48 hours.
If you configure both Full Migration and Incremental Synchronization when creating the data migration task, OMS requires that the source database's archive logs be retained for at least 7 days. Otherwise, the data migration task may fail due to inability to obtain incremental logs, potentially leading to data inconsistency between the source and target.
If table objects differing only in case exist at the source or target, the data migration result may not meet expectations due to case-insensitivity at the source or target.
For incremental synchronization tasks from an Oracle database (except those obtaining incremental data via Kafka), if a single transaction spans archives, LogMiner may not correctly return complete data information across these archives, potentially leading to data loss. It is recommended to configure full data verification and data correction to ensure data consistency.
If performing incremental synchronization with OceanBase Database as the source, or reverse incremental migration with OceanBase Database as the target, and the database table objects contain UDT columns, the incremental synchronization task may fail due to unsupported UDT columns.
Data type mappings
Notice
When the target is OceanBase Database in Oracle compatible mode earlier than V4.2.0, CLOB and BLOB data must be less than 48 MB.
When the target is OceanBase Database in Oracle compatible mode V4.2.0 or later, CLOB and BLOB data support up to 512 MB.
Migrating data of the ROWID, BFILE, XMLType, UROWID, UNDEFINED, or UDT type is not supported.
Incremental synchronization is not supported for tables of the LONG or LONG RAW data type.
Oracle Database |
Oracle compatible mode of OceanBase Database |
|---|---|
| CHAR(n CHAR) | CHAR(n CHAR) |
| CHAR(n BYTE) | CHAR(n BYTE) |
| NCHAR(n) | NCHAR(n) |
| VARCHAR2(n) | VARCHAR2(n) |
| NVARCHAR2(n) | NVARCHAR2(n) |
| NUMBER(n) | NUMBER(n) |
| NUMBER (p, s) | NUMBER(p,s) |
| RAW | RAW |
| CLOB | CLOB |
| NCLOB |
|
| BLOB | BLOB |
| REAL | FLOAT |
| FLOAT(n) |
|
| BINARY_FLOAT | BINARY_FLOAT |
| BINARY_DOUBLE | BINARY_DOUBLE |
| DATE | DATE |
| TIMESTAMP | TIMESTAMP |
| TIMESTAMP WITH TIME ZONE | TIMESTAMP WITH TIME ZONE |
| TIMESTAMP WITH LOCAL TIME ZONE | TIMESTAMP WITH LOCAL TIME ZONE |
| INTERVAL YEAR(p) TO MONTH | INTERVAL YEAR(p) TO MONTH |
| INTERVAL DAY(p) TO SECOND | INTERVAL DAY(p) TO SECOND |
| LONG | CLOB
NoticeIncremental synchronization is not supported for this data type. |
| LONG RAW | BLOB
NoticeIncremental synchronization is not supported for this data type. |
| SDO_GEOMETRY | SDO_GEOMETRY
NoticeThis data type is supported in OceanBase Database Oracle mode V4.2.2 and later. |
| XML | XML |
Conversion of Oracle table partitions
When OMS migrates data from an Oracle database, it adapts and converts business SQL usage. OceanBase Database V2.2.30 and V2.2.50 differ in their adaptation and conversion methods for certain SQL statements.
Note
The partition conversion rules described in this topic apply to all partition types.
Original Table Definition |
Output of OceanBase Database V2.2.30 conversion |
Conversion Output for OceanBase Database V2.2.50 and Later |
|---|---|---|
CREATE TABLE T_RANGE_0 (A INT, B INT, PRIMARY KEY (B) )PARTITION BY RANGE(A)(....); |
CREATE TABLE "T_RANGE_0" ("A" NUMBER, "B" NUMBER NOT NULL, PRIMARY KEY ("B", "A") )PARTITION BY RANGE ("A")(.... ); CREATE UNIQUE INDEX ON "T_RANGE_0"(B);
|
CREATE TABLE "T_RANGE_0" ("A" NUMBER, "B" NUMBER NOT NULL,CONSTRAINT "T_RANGE_10_UK" UNIQUE ("B") )PARTITION BY RANGE ("A")( .... ); |
CREATE TABLE T_RANGE_10 ("A" INT, "B" INT, "C" DATE, "D" NUMBER GENERATED ALWAYS AS (TO_NUMBER(TO_CHAR("C",'dd'))) VIRTUAL, CONSTRAINT "T_RANGE_10_PK" PRIMARY KEY (A) )PARTITION BY RANGE(D)( .... ); |
CREATE TABLE T_RANGE_10 ("A" INT NOT NULL,"B" INT,"C" DATE,"D" NUMBER GENERATED ALWAYS AS (TO_NUMBER(TO_CHAR("C",'dd'))) VIRTUAL,CONSTRAINT "T_RANGE_10_PK" PRIMARY KEY (A, C) )PARTITION BY RANGE(D)( .... ); |
CREATE TABLE T_RANGE_10 ("A" INT NOT NULL,"B" INT,"C" DATE,"D" NUMBER GENERATED ALWAYS AS (TO_NUMBER(TO_CHAR("C",'dd'))) VIRTUAL,CONSTRAINT "T_RANGE_10_PK" UNIQUE (A) )PARTITION BY RANGE(D)( .... ); |
CREATE TABLE T_RANGE_1 (A INT,B INT,UNIQUE (B) )PARTITION BY RANGE(A)( partition P_MAX values less than (10) ); |
-- [WARNING] Create global index on no primary key table is unsupported. Object: "GUYUE"."T_RANGE_1" | Supports original table definition |
CREATE TABLE T_RANGE_2 (A INT,B INT NOT NULL,UNIQUE (B) )PARTITION BY RANGE(A)( partition P_MAX values less than (10) ); |
CREATE TABLE "T_RANGE_2" ("A" NUMBER,"B" NUMBER NOT NULL,PRIMARY KEY ("B", "A") )PARTITION BY RANGE ("A")( .... ); |
Supports original table definition |
CREATE TABLE T_RANGE_3 (A INT,B INT,UNIQUE (A) )PARTITION BY RANGE(A)( .... ); |
-- [WARNING] Create global index on no primary key table is unsupported. Object: "GUYUE"."T_RANGE_2" | Supports original table definition |
CREATE TABLE T_RANGE_4 (A INT NOT NULL,B INT,UNIQUE (A) )PARTITION BY RANGE(A)( .... ); |
CREATE TABLE "T_RANGE_4" ("A" NUMBER NOT NULL,"B" NUMBER,PRIMARY KEY ("A") )PARTITION BY RANGE ("A")( .... ); |
CREATE TABLE "T_RANGE_4" ("A" NUMBER NOT NULL,"B" NUMBER,PRIMARY KEY ("A") )PARTITION BY RANGE ("A")( .... ); |
CREATE TABLE T_RANGE_5 (A INT,B INT,UNIQUE (A, B) )PARTITION BY RANGE(A)( partition P_MAX values less than (10) ); |
-- [WARNING] Create global index on no primary key table is unsupported. Object: "GUYUE"."T_RANGE_5" | Supports original table definition |
CREATE TABLE T_RANGE_6 (A INT NOT NULL,B INT,UNIQUE (A, B) )PARTITION BY RANGE(A)( partition P_MAX values less than (10) ); |
-- [WARNING] Create global index on no primary key table is unsupported. Object: "GUYUE"."T_RANGE_5" | Supports original table definition |
CREATE TABLE T_RANGE_7 (A INT NOT NULL,B INT NOT NULL,UNIQUE (A, B) )PARTITION BY RANGE(A)( partition P_MAX values less than (10) ); |
CREATE TABLE "T_RANGE_7" ("A" NUMBER NOT NULL,"B" NUMBER NOT NULL,PRIMARY KEY ("A", "B") )PARTITION BY RANGE ("A")( .... ); |
CREATE TABLE "T_RANGE_7" ("A" NUMBER NOT NULL,"B" NUMBER NOT NULL,PRIMARY KEY ("A", "B") )PARTITION BY RANGE ("A")( .... ); |
CREATE TABLE T_RANGE_8 ("A" INT,"B" INT,"C" INT NOT NULL,UNIQUE (A),UNIQUE (B),UNIQUE (C) )PARTITION BY RANGE(B)( partition P_MAX values less than (10) ); |
CREATE TABLE "T_RANGE_8" ("A" NUMBER,"B" NUMBER,"C" NUMBER NOT NULL,PRIMARY KEY ("C", "B"),UNIQUE ("A"),UNIQUE ("B"),UNIQUE ("C") )PARTITION BY RANGE ("B")( .... ); |
Supports original table definition |
CREATE TABLE T_RANGE_9 ("A" INT,"B" INT,"C" INT NOT NULL,UNIQUE(A),UNIQUE(B),UNIQUE (C) )PARTITION BY RANGE(C)( partition P_MAX values less than (10) ); |
CREATE TABLE "T_RANGE_9" ("A" NUMBER,"B" NUMBER,"C" NUMBER NOT NULL,PRIMARY KEY ("C"),UNIQUE ("A"),UNIQUE ("B") )PARTITION BY RANGE ("C")( .... ); |
CREATE TABLE "T_RANGE_9" ("A" NUMBER,"B" NUMBER,"C" NUMBER NOT NULL,PRIMARY KEY ("C"),UNIQUE ("A"),UNIQUE ("B") )PARTITION BY RANGE ("C")( .... ); |
Check and modify the system configuration of the Oracle instance
You need to perform the following operations:
Enable archiving mode in the source Oracle database.
Enable supplemental logging in the source Oracle database.
(Optional) Set system parameters of the Oracle database.
Enable archiving mode in the source Oracle database
SELECT log_mode FROM v$database;
The value of the log_mode field must be archivelog. Otherwise, you need to modify it as follows.
Run the following command to enable archiving mode.
SHUTDOWN IMMEDIATE; STARTUP MOUNT; ALTER DATABASE ARCHIVELOG; ALTER DATABASE OPEN;Run the following command to view the path and quota of the archived logs.
Check the path and quota of
recovery file. It is recommended that you set thedb_recovery_file_dest_sizeparameter to a large value. After enabling archiving, you need to regularly clean up the archived logs by using methods such as RMAN.SHOW PARAMETER db_recovery_file_dest;Modify the quota of the archived logs based on your business requirements.
ALTER SYSTEM SET db_recovery_file_dest_size =50G SCOPE = BOTH;
Enable supplemental logging in the source Oracle database
For more information about supplemental logging in Oracle databases, see Supplemental logging in Oracle databases.
Set system parameters of the Oracle database (optional)
We recommend that you set the system parameter _log_parallelism_max of the Oracle database to 1. Typically, this system parameter has a default value of 2.
Query the value of
_log_parallelism_max. You can query it in the following two ways:Method 1
SELECT NAM.KSPPINM,VAL.KSPPSTVL,NAM.KSPPDESC FROM SYS.X$KSPPI NAM,SYS.X$KSPPSV VAL WHERE NAM.INDX= VAL.INDX AND NAM.KSPPINM LIKE '_%' AND UPPER(NAM.KSPPINM) LIKE '%LOG_PARALLEL%';Method 2
SELECT VALUE FROM v$parameter WHERE name = '_log_parallelism_max';
Modify the value of
_log_parallelism_max. The modification depends on the following two scenarios:For modifications in an Oracle RAC instance:
ALTER SYSTEM SET "_log_parallelism_max" = 1 SID = '*' SCOPE = spfile;For modifications in a non-Oracle RAC instance:
ALTER SYSTEM SET "_log_parallelism_max" = 1 SCOPE = spfile;
When modifying the
_log_parallelism_maxparameter in Oracle Database 10g, if the errorwrite to SPFILE requested but no SPFILE specified at startupoccurs, perform the following operation:CREATE SPFILE FROM PFILE; SHUTDOWN IMMEDIATE; STARTUP; SHOW PARAMETER SPFILE;After modifying the system parameter
_log_parallelism_max, restart the instance, switch the archive logs twice, and wait for more than 5 minutes before starting the task.
Procedure
Create a data migration task.
Log in to the OMS console.
In the left-side navigation pane, click Data Migration.
On the Data Migration page, click Create Task in the upper-right corner.
On the Create Task page, customize the name of the migration task.
We recommend that you use a combination of Chinese characters, numbers, and letters. The name cannot contain spaces and must not exceed 64 characters in length.
Note
The task name is a unique identifier within the OMS system. Please choose an appropriate name for your task.
In the Select Source and Target step, configure the parameters.
ParameterDescriptionSource If you have created an Oracle data source, select it from the drop-down list. If not, click New Data Source in the drop-down list to create one in the dialog box on the right. For more information, see Create an Oracle data source. Destination If you have created an OceanBase Database data source in Oracle compatible mode (including a physical data source, public cloud data source, or standalone data source), select it from the drop-down list. If not, click New Data Source in the drop-down list to create one in the dialog box on the right. For more information, see Create a physical OceanBase data source, Create a public cloud OceanBase data source, or Create a standalone OceanBase data source. Tag (Optional) Click the text box and select a target tag from the drop-down list. You can also click Manage Tags to create, modify, or delete tags. For more information, see Manage data migration tasks by using tags. Click Next. In the Select Migration Type step, select One-Way Synchronization for Synchronization Topology.
OMS supports One-Way Synchronization and Two-Way Synchronization. This topic describes how to perform one-way synchronization. For more information about two-way synchronization, see Configure a two-way synchronization task.
In the Migration Options section, select the migration type for the current data migration task.
Migration Type includes Schema Migration, Full Migration, Incremental Synchronization, and Reverse Increment.
Migration TypeDescriptionSchema Migration Responsible for migrating data object definitions (such as tables, indexes, constraints, comments, and views) from the source database to the target database. Temporary tables are automatically filtered out. Full Migration After a full migration task starts, OMS migrates the existing data of tables from the source database to the corresponding tables in the target database. If you select Full Migration, we recommend that you collect statistics from the Oracle database using the GATHER_SCHEMA_STATSorGATHER_TABLE_STATSstatement before migrating data.Incremental Synchronization After an incremental synchronization task starts, OMS synchronizes changed data (inserts, modifications, or deletions) from the source database to the corresponding tables in the target database.
Incremental Synchronization includes DML synchronization and DDL synchronization, which you can configure as needed. For more information, see Configure DDL/DML synchronization. The usage limitations for Incremental Synchronization are as follows:- If you select DDL synchronization, there is a risk of data migration interruption when the source database performs a DDL operation that OMS does not support.
- If the DDL operation is to add a column, we recommend that you set the column's attribute to Null. Setting a default value when adding the column carries a risk of data migration interruption.
If a default value must be set, you can bypass this by first adding the column and then setting the default value. - Incremental synchronization is not currently supported for tables that use the
empty_clob()function in the source Oracle database.
Reverse Increment After a reverse increment task starts, it can continuously flow back the change data generated in the target database after the business switchover to the source database in real time.
Typically, reverse increment reuses the configuration of incremental synchronization, but you can also customize it according to actual needs. If a migrated table has no primary key or unique index and the volume of changes for that table is large, it will take a long time for the reverse increment. In this case, you can add a unique index in the source database.
The following situations do not support selecting Reverse Increment:- Multiple tables are involved in data aggregation.
- There is a one-to-many schema mapping.
(Optional) Click Next.
If you select Reverse Increment, but the corresponding parameter is not configured for the target OceanBase Database data source in Oracle compatible mode, the Add Data Source Information dialog box appears, prompting you to configure it. For parameter details, see Create an OceanBase physical data source, Create an OceanBase public cloud data source, or Create an OceanBase standalone data source.
After completing the supplementary configuration, click Test connectivity. After the connection test succeeds, click Save.
Click Next. In the Select Migration Objects step, select the objects that need to be migrated for the current data migration task.
You can select migration objects through two options: Specify Objects and Match by Rule. This topic describes how to select migration objects by specifying objects. For details on configuring matching rules, see Configure matching rules.
Note
If a database name or table name contains the character "$$", it will affect the creation of the data migration task.
If you have selected DDL Synchronization in the Select Migration Type step, it is recommended to select migration objects using matching rules to ensure all newly added objects that meet the migration object rules are synchronized. If you select migration objects by specifying objects, newly added objects or renamed objects will not be synchronized.
OMS automatically filters out unsupported objects. For SQL statements used to query objects, see Query database objects.
In the Select Migration Objects step, select Specify Objects.
In the Source Object(s) list, select the objects that need to be migrated.
If you have selected Schema Migration in the Select Migration Type step, you can select one or more databases' Sequence (sequences), Type (custom types), Table (tables), View (views), Procedure (stored procedures), Function (functions), Package (packages), Trigger (triggers), and Synonym (private synonyms only) as migration objects.
Note
- When only Schema Migration is selected, please select at least one object. When other types are selected besides Schema Migration, please select at least one table object.
- Triggers and synonyms must be manually selected when the param struct_trigger_synonym_migration_mode is configured to manual. If not shown, the system will default to migrating triggers and synonym objects associated with other objects to be migrated. For parameter configuration, see Modify system parameters
The following objects are triggered only when you select Schema Migration. The migration timing for different types of objects is as follows:
Tables, views, stored procedures, functions, synonyms, custom types, and package objects are automatically migrated during schema migration.
The migration timing for normal indexes and trigger objects can be set via migration options.
Sequences, constraints, and foreign key objects are migrated additionally during forward switchover.
If you do not select Schema Migration in the Select Migration Type step, you can only support selecting tables from one or more databases as migration objects.
Click > to add it to the Target Object list.
OMS supports importing objects via text, and supports operations such as renaming target objects, setting row filters, selecting partitions and columns, and removing single or all migration objects.
Note
When you select migration objects by using the matching rule method, the renaming capability is overridden by the matching rule syntax. You can only set filter conditions in the operation field. For more information, see Configure matching rules.
PL objects such as views, functions, and stored procedures do not support operations such as renaming, setting row filter conditions, selecting partitions, or selecting columns.
OperationStepImport objects - In the Target Objects list, click Import Objects in the upper-right corner.
- In the dialog box, click OK.
Note: The import will overwrite previous operation selections. Proceed with caution. - In the Import Migration Objects dialog box, import the objects to be migrated.
You can rename databases and tables, set row filter conditions, and perform other operations by importing a CSV file. For more information, see Download and import migration object configurations. - Click Validate.
- After passing the legality validation, click OK.
Rename OMS supports renaming migration objects. For more information, see Rename a database or table. Settings OMS supports configuring row filtering, selected partitions, and columns to migrate for table objects. - In the right-side list of the selection area, hover your mouse over the target object.
- Click the displayed Settings.
- In the Settings dialog box, you can perform the following operations.
-
In the text box of the Row Filters section, enter a standard SQL WHERE clause to configure row filtering. For more information, see Filter data with SQL conditions.
- In the drop-down list of the Partition section, select the specified partition data you need to retrieve during the full migration phase. After making the selection, click OK.
- In the Select Columns section, select the columns to migrate. For more information, see Column filtering.
Remove/Remove All OMS supports removing one or more temporarily selected objects to the target during data mapping. - Remove a single migration object
In the Target Objects list, hover your mouse over the target object and click the displayed Remove to remove that migration object. - Remove all migration objects
In the Target Objects list, click Remove All in the upper-right corner. In the dialog box, click OK to remove all migration objects.
Change Schema OMS supports changing the schema of target database tables during data migration. Select the objects whose schemas need to be changed in the selected area, click Change Schema below, enter the target schema name in the pop-up window, and click OK. After configuration, you can view the actual migration effect in the selected area. When performing row filtering on an Oracle database as the source, if the filter is not based on the primary key or unique key, enable supplementary logging for the corresponding columns, or enable supplementary logging at the ALL level.
To enable supplementary logging for a specific column:
ALTER TABLE table_name ADD SUPPLEMENTAL LOG GROUP log_group_name (column1, column2, column3) ALWAYS;To enable supplementary logging at the ALL level:
--Method 1: Enable at the database level ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS; --Method 2: Enable table-level ALTER TABLE table_name ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;Click Next. In the Migration Options step, configure the parameters.
Schema migration
The following parameters are displayed only if you have selected One-way Synchronization > Schema Migration in the Select Migration Type step.
ParameterDescriptionAutomatically proceed to the next stage upon completion If the selected migration type includes schema migration, you can configure whether to automatically proceed to the next stage after schema migration is complete. The default value is Yes. You can also view and modify this setting on the Schema Migration tab of the data migration task details page. Normal index migration method Refers to the migration method for non-unique key indexes associated with a table object after migration. Valid values: Do Not Migrate, Migrate with Schema, and Post-Full-Migration (this option is displayed only when Full Migration is selected). Trigger migration method Refers to the migration method for triggers associated with a table object after migration. Valid values: Do Not Migrate, Migrate with Schema, and Forward Switchover Migration. Note
- If the selected migration type includes only Schema Migration, the default option is Do Not Migrate, and Forward Handover Migration cannot be selected.
- If the Selected Migration Type includes more than just Schema Migration, Migrate with Schema cannot be selected.
Synonym migration method Refers to the migration method for synonyms associated with a table object after migration. Valid values: Do Not Migrate, Migrate with Schema, and Forward Switchover Migration. Note
- If the selected migration type includes only Schema Migration, the default option is Do Not Migrate, and Forward Handover Migration cannot be selected.
- If the Selected Migration Type includes more than just Schema Migration, Migrate with Schema cannot be selected.
Full migration
In the Select Migration Type step, only when you select One-way Synchronization > Full Migration are the following parameters displayed.
ParameterDescriptionFull migration rate limit You can decide whether to enable the full migration rate limit based on your actual needs. If enabled, set the RPS (the maximum number of data rows that can be migrated to the target per second during the full migration phase) and BPS (the maximum amount of data that can be migrated to the target per second during the full migration phase). Note
The RPS and BPS set here are only for throttling. The actual achievable performance during full migration is limited by factors such as the source, target, and instance specifications.
Full migration resource configuration You can choose the default read concurrency, write concurrency, and memory for Small, Medium, or Large. You can also customize the resource configuration for full migration. By configuring resources for the Full-Import component, you can limit the resource consumption of a task during the full migration phase. Notice
For custom configurations, the minimum value is 1, and only integers are supported.
Processing strategy when target table has records The processing strategies include Ignore and Stop Migration: - If you select Ignore, when data exists in the target table and conflicts with the data to be written, OMS logs the conflicting data and retains the original data unchanged.
Notice
If you select Ignore, full verification will pull data in IN mode, which cannot verify scenarios where the target has data not present in the source, and verification performance will be degraded to some extent.
- If you select Stop Migration, when data exists in the target table, an error is reported during full migration indicating that migration is not allowed. You must handle the data in the target before continuing the migration.
Notice
If you click Resume after an error occurs, OMS will ignore this configuration option and continue migrating table data. Proceed with caution.
- If you select Ignore, when data exists in the target table and conflicts with the data to be written, OMS logs the conflicting data and retains the original data unchanged.
Incremental Synchronization
In the Select Migration Type step, only when you select One-way Synchronization > Incremental Synchronization are the following parameters displayed.
ParameterDescriptionIncremental synchronization rate limit You can decide whether to enable the incremental synchronization rate limit based on your actual needs. If enabled, set the RPS (the maximum number of data rows that can be synchronized to the target per second during incremental synchronization) and BPS (the maximum amount of data that can be synchronized to the target per second during incremental synchronization). Note
The RPS and BPS set here are only for throttling. The actual achievable performance during incremental synchronization is limited by factors such as the source, target, and instance specifications.
Incremental log pull resource configuration You can choose the default memory for Small, Medium, or Large. You can also customize the resource configuration for incremental log pull. By configuring resources for the Store component, you can limit the resource consumption for log pulling during the incremental synchronization phase. Notice
- For custom configurations, the minimum value is 1, and only integers are supported.
- If the Oracle data source is configured with Obtain incremental data via Kafka, this parameter is not displayed.
Incremental data write resource configuration You can choose the default write concurrency and memory for Small, Medium, or Large. You can also customize the resource configuration for incremental data write. By configuring resources for the Incr-Sync component, you can limit the resource consumption for data writing during the incremental synchronization phase. Notice
- For custom configurations, the minimum value is 1, and only integers are supported.
- If the Oracle data source is configured with Obtain incremental data via Kafka, the read concurrency is configured as the number of concurrent reads from Kafka during incremental synchronization. The default value is 4, the minimum value is 1, and the maximum value is 512. It is recommended to set the maximum value to the number of partitions corresponding to the Kafka topic.
Incremental record retention time The duration for which incremental parsed files are cached in OMS. A longer configured retention time requires more disk space for the Store component. Notice
If the Oracle data source is configured with Obtain incremental data via Kafka, this parameter is not supported.
Incremental synchronization start timestamp - If Full Migration was selected as the migration type, this parameter is not displayed.
- If Full Migration was not selected but Incremental Synchronization was selected, specify a point in time after which data should be migrated. The default is the current system time. For details, see Set an incremental synchronization timestamp.
Reverse Increment
In the Select Migration Type step, only when you select Reverse Increment are the parameters in this section displayed. The configuration parameters for reverse increment are the same as those for incremental synchronization. You can select Reuse Incremental Synchronization Configuration in the upper-right corner.
Advanced Options
ParameterDescriptionCharacter encoding and length definition options This parameter is displayed only when you select Schema Migration on the Select Migration Type page and the character sets at the source and target are different. It specifies the conversion behavior for schema migration and incremental DDL operations when the source field types are CHAR, VARCHAR, or VARCHAR2 and the length unit is BYTE. You can customize the effective range (CHAR, VARCHAR, or VARCHAR2) and implementation effect. - Ignores field length units during migration, depending on the target NLS_LENGTH_SEMANTICS configuration. That is, N BYTE -> N
- Forces the conversion of field length units from BYTE to CHAR. That is, N BYTE -> N CHAR
- Automatically increases the length of target fields. That is, N BYTE -> X*N BYTE
- Performs no conversion. That is, N BYTE -> N BYTE
Add hidden columns for non-null unique key tables When migrating data from an Oracle database to an OceanBase database in Oracle compatible mode, you need to configure whether to add hidden columns for non-null unique key tables. For more information, see Hidden column mechanism description in Data Migration Service.
If you select No, data duplication may occur for tables without a primary key or a non-null unique key if the task restarts or an exception occurs. It is recommended to configure a non-null unique key for all tables.Target table object storage type This parameter is displayed only when the target OceanBase database in Oracle compatible mode is V4.3.0 or later, and you select Schema Migration or Incremental Synchronization > DDL synchronization on the Select Migration Type step.
The target table object storage types include Default, Row Storage, Column Storage, and Hybrid Row-Column Storage. This configuration determines the storage type for target table objects during schema migration or incremental synchronization. For more information, see default_table_store_format.Note
The Default option adapts other options based on the target parameters. It writes the corresponding structure for table objects migrated by schema or for newly added tables by incremental DDL according to the configured storage type.
The following parameters are displayed only if you do not select One-way Synchronization > Schema Migration and One-way Synchronization > Reverse Increment on the Select Migration Type step.
Synchronize Data is disabled by default. After enabling it, you can write specified data (such as source schemas or values of other custom fields) to specified fields in the target.
ParameterDescriptionSynchronize Schema Name If you choose to synchronize the schema name, specify the field name and ensure this field exists in the schema of all tables to be synchronized at the target. Synchronize Custom Data After enabling this option, enter the Specify Field Name and Field Value. You can synchronize custom values as strings to specified fields of target tables to be synchronized.<
If the configuration parameters on the page do not meet your requirements, you can click Parameter Configuration at the bottom of the page for more specific configurations. If you have configured a task template or component template, you can also reference it here.
Click Precheck to have the system perform a precheck on the data migration task.
During the Precheck step, OMS checks whether the read/write permissions of the database user and the network connection of the database meet the requirements. The data migration task can only be started after all check items pass. If the precheck reports an error:
You can troubleshoot and resolve the issue, then re-execute the precheck until it succeeds.
You can also click Skip in the Actions column of the failed precheck item. A dialog box appears, explaining the specific impact of skipping this operation. After confirming you can skip it, click OK in the dialog box.
Click Start Task. If you do not need to start the task immediately, click Save to go to the details page of the data migration task, where you can start it manually as needed.
You can click Configure Validation Task in the upper-right corner of the data migration details page to compare data differences between the source and target databases. For more information, see Create a data verification task.
OMS supports modifying migration objects during the execution of a data migration task. For more information, see View and modify migration objects. After a data migration task is started, it is executed in sequence based on the selected migration type. For more information, see the "View migration details" section in View details of a data migration task.