This topic describes how to use OceanBase Migration Service (OMS) to migrate data from an SQL Server database to OceanBase Database in Oracle compatible mode (including physical data sources, public cloud data sources, and standalone data sources).
Background information
SQL Server is a relational database management system developed by Microsoft. By creating a data migration task in the OMS console to migrate data from an SQL Server database to the Oracle compatible mode of OceanBase Database, you can seamlessly migrate the existing business data and incremental data from the source database to the Oracle compatible mode of OceanBase Database through schema migration, full migration, incremental synchronization, and reverse incremental migration.
In the OMS console, the data source type for SQL Server is displayed as SQLServer.
Schema migration: Migrates data object definitions such as table schemas from an SQL Server database to the Oracle compatible mode of OceanBase Database. Data types and SQL syntax are automatically converted according to OMS's mapping rules.
Full migration: Migrates the existing data from an SQL Server database to the Oracle compatible mode of OceanBase Database.
Incremental synchronization: Based on the SQL Server CDC feature, it synchronizes incremental change data (DML and DDL) from an SQL Server database to the Oracle compatible mode of OceanBase Database in real time.
Reverse incremental migration: After business switchover, it reversely flows the change data generated in the target OceanBase Database in Oracle compatible mode back to the source SQL Server database in real time.
Prerequisites
A corresponding schema has been created in the target OceanBase Database in Oracle compatible mode.
A dedicated database user for the data migration task has been created for both the source SQL Server database and the target OceanBase Database in Oracle compatible mode, and the relevant privileges have been granted. For details, see Create a database user and User privileges.
An SQL Server data source and an OceanBase Database in Oracle compatible mode data source have been created in OMS. For details, see Create an SQL Server data source.
Clock synchronization is required between the machine where the SQL Server database resides and the OMS machine (for example, configure the NTP service). Otherwise, the latency reported for incremental synchronization may be inaccurate.
If incremental synchronization is to be performed, the source SQL Server database must meet the following conditions:
The database's log recovery mode (Recovery Mode) has been set to
FULL.At least one full physical backup and one log backup have been successfully performed.
The
srvnamefield in thesys.sysserversview is consistent with the return value of theSERVERPROPERTYfunction. If they are inconsistent, adjust the SQL Server server name and then restart the SQL Server service.The SQL Server Agent service is running. SQL Server CDC depends on Agent jobs. Ensure the CDC job is running normally; otherwise, the data migration task will fail.
CDC has been enabled for the database using an account with
sysadminprivileges. The method is as follows.-- Switch to the database to be migrated. Subsequent statements will act on the current database. USE [<database_name>]; GO -- Confirm the current database is correct. SELECT DB_NAME() AS current_database; GO -- This statement is executed only when CDC is not enabled for the current database. IF (SELECT is_cdc_enabled FROM sys.databases WHERE name = DB_NAME()) = 0 EXECUTE sys.sp_cdc_enable_db; GO -- Check the current CDC status of the database. A return value of 1 indicates that it is enabled. SELECT name, is_cdc_enabled FROM sys.databases WHERE name = DB_NAME(); GONotice
sys.sp_cdc_enable_dbacts on the current database and does not automatically switch to<database_name>. Be sure to executeUSE [<database_name>]first and confirm withDB_NAME(); otherwise, it may act on the wrong database or fail.Note
Table-level CDC capture instances are automatically created and maintained by OMS. You do not need to manually execute
sys.sp_cdc_enable_table. For details, see the "Objects created by OMS at the source" section in the "Considerations" section of this topic.The tables to be migrated already have a primary key or a non-nullable unique key. A single SQL Server table supports at most two CDC capture instances. If the number of existing CDC instances for the tables to be migrated reaches the limit, OMS will be unable to create new CDC instances, causing incremental synchronization to fail.
Notice
Do not manually enable CDC for tables being synchronized by OMS.
Limitations
Only supports SQL Server Enterprise Edition on Windows operating systems, with supported versions being 2008, 2008 R2, 2012, 2014, 2016, 2017, and 2019.
OMS does not migrate objects or data from SQL Server system databases, including
master,msdb,model,tempdb, andresource.OMS does not migrate objects or data under the system schema, including
sys,INFORMATION_SCHEMA,cdc, andguest.Migration only supports tables; other object types such as views, stored procedures, and functions are not supported.
OMS does not support migrating tables without a NOT NULL unique key, memory-optimized tables, temporary tables, or compressed tables. Please manually exclude the aforementioned tables in the Select Migration Objects step.
OMS does not support migrating the
hierarchyidandsql_variantdata types. If a table to be migrated contains columns of these types, schema migration or incremental synchronization may fail. Thehierarchyidtype is intercepted during the precheck phase.The following types are supported only during schema migration and not during incremental synchronization for changing these type columns:
uniqueidentifier: Mapped toVARCHAR2(36)during schema migration.xml: Mapped toXMLTYPEwhen the target is OceanBase Database in Oracle compatible mode V4.2 or later.geometry,geography: Mapped toSDO_GEOMETRYwhen the target is OceanBase Database in Oracle compatible mode V4.2.2 or later.
The SQL Server
timestamp(i.e.,rowversion) type is migrated to OceanBase Database in Oracle compatible mode as 8 bytes of binary data and is not mapped to a time type. This conversion applies to both full migration and incremental synchronization of INSERT and UPDATE operations from the source, ensuring byte-for-byte consistency between the source and target. Version numbers are not automatically generated for local writes at the target.OMS does not support triggers (Triggers) at the target. If a target table has triggers, data migration may fail or the write results may not meet expectations.
Incremental synchronization does not support obtaining incremental data for the following columns:
Computed columns: Data for computed columns is automatically generated by the target database based on the computation logic.
Sparse columns written using column sets: Incremental data for sparse columns generated by regular writing methods is supported.
Columns with column-level encryption.
OMS does not enforce validation of primary/standby database attributes in SQL Server. However, incremental synchronization only supports synchronization from the primary database, and this is only possible if the CDC service is enabled for the SQL Server primary replica. SQL Server Always On availability groups are not supported for migration.
This link only supports unidirectional migration and does not support bidirectional synchronization topologies. If you need to flow data back after a business switch, configure reverse incremental synchronization. For related limitations, see the "Limitations of Reverse Incremental Synchronization" section below.
Data source identifiers, database user accounts, etc., must remain globally unique within the OMS system.
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
.|"'`()=;/&\).When migrating SQL Server's
IDENTITYauto-increment columns to OceanBase Database in Oracle compatible mode, retaining the auto-increment start value and step size (for example, the start value 10 and step size 3 inIDENTITY(10,3)) is not supported.The maximum size for SQL Server's large object types (
VARCHAR(MAX),NVARCHAR(MAX),TEXT,NTEXT,VARBINARY(MAX), andIMAGE) is 2 GB, while the corresponding maximum single-value size forCLOB/BLOBin OceanBase Database in Oracle compatible mode is 48 MB. Data exceeding this limit cannot be migrated.SQL Server does not support updating the values in an
IDENTITYauto-increment column. Therefore, a business practice that relies on updating auto-increment columns to align data writes is not feasible in this direct link.XML indexes in SQL Server are converted into regular indexes during schema migration. Executions on such indexes at the target will fail as expected. Do not rely on the capability of XML indexes.
If the character encoding of a source
charorvarcharcolumn is inconsistent with that of the target, data write errors or garbled Chinese characters may occur. Both forward synchronization and reverse incremental synchronization are affected. The common sort rule in SQL Server isSQL_Latin1_General_CP1_CI_AS. Before migration, confirm that the target character set can accommodate your business data (for example, useutf8mb4), or switch to usingncharornvarcharto store Chinese.After configuring row filter conditions for migration objects, row count verification compares filtered values case by case, which is not entirely consistent with the behavior during full migration or full verification. Please refer to the results of the full verification and resolve any verification discrepancies before business switchover.
Limitations on Reverse Increment
Reverse increment does not support ETL configurations.
The
datetimetype in SQL Server is imprecise. High-precision decimals written back to the source from the target may be rounded (for example, a decimal578at the target may become577when written back to the source), leading to data inconsistency between the two ends. For restrictions on thedatetype, see the "Data type mapping" section below.When adding a NOT NULL column to a table with existing data at the target, SQL Server requires the column to have a default value; otherwise, the reverse incremental DDL will report an error when executed at the source. OceanBase Database in Oracle compatible mode does not have this restriction.
When deleting a source column via reverse incremental DDL, if the column is still referenced by a default value, constraint, or index, an error will occur when synchronizing to SQL Server.
After the target
MONEYdata type is mapped toNUMBER(19, 4), values exceeding the SQL ServerMONEYrange can be written. Reverse incremental writing back to the source will fail.When modifying a column via reverse increment, SQL Server requires explicitly retaining the
NOT NULLattribute; otherwise, the column becomes nullable. OceanBase Database in Oracle compatible mode does not support setting column attributes simultaneously when configuring this change, and such incremental DDL will report an error.
Considerations
Limitations on operations in the source database
Do not perform DDL operations that modify database or table schemas during schema migration or full migration. Otherwise, this may cause schema inconsistencies, failure of full data loading, or interruption of the data migration task.
Incremental synchronization supports synchronizing some DDL operations. For more information, see Synchronize DDL operations from an SQL Server database to an OceanBase database. When performing DDL operations in a production environment, follow these limitations:
Do not perform DDL operations during peak business hours. Otherwise, data loss may occur. Perform schema changes during off-peak hours or maintenance windows.
Do not frequently perform DDL operations on the same table, such as executing
ALTER TABLEmultiple times in a short period. An SQL Server database supports at most two CDC capture instances per table. When a task is restarted, at most oneALTER TABLEoperation is allowed for the same table.Do not perform DDL operations when the OMS synchronization latency is high. When the synchronization latency is high, a switch in the CDC instance may pose a risk to incremental data continuity.
Do not modify the primary key or unique key configuration of the source table. Such DDL operations are not supported for synchronization to the target and may cause inaccurate incremental data positioning, leading to data quality issues.
If you need to perform high-risk DDL operations such as
DROP TABLE,RENAME, splitting, or merging tables, first pause or adjust the OMS task and handle the target objects according to the O&M process.Before performing DDL operations on a table already synchronized by OMS, ensure the OMS task status is normal and the synchronization latency is acceptable.
After performing production DDL changes, perform data verification (such as table schema comparison, row count comparison of key tables, or sample data comparison) to ensure data consistency between the source and target. For more information, see Create a data verification task.
Log retention requirements
The default retention period for changed data captured by SQL Server CDC is 72 hours, which you can adjust based on your business needs. OMS requires that there be no less than 48 hours of incremental data available for consumption at the source. It is recommended to ensure that the CDC data retention period is longer than this value.
If a data migration task is configured with only Incremental Synchronization, the source transaction logs or log backups must be retained for more than 48 hours.
If a data migration task is configured with both Full Migration and Incremental Synchronization, the source transaction logs or log backups must be retained for at least 7 days.
If the log retention period is insufficient, OMS may be unable to obtain incremental logs, causing the data migration task to fail or even leading to data inconsistency between the source and target.
Incremental synchronization depends on the SQL Server CDC feature. CDC stores incremental data separately in the current database. Please properly evaluate the size of the database data files to avoid business impact due to CDC data bloat.
If a leader-follower replica switchover occurs in SQL Server, it will cause the OMS task to fail. You will need to rebuild the data migration task.
OMS may install database-level DDL triggers in the source database to record DDL history and maintain SQL Server CDC capture instances. Specifically:
When a substantial
ALTER TABLEoperation is performed, the trigger may create a new CDC capture instance and, if necessary, switch the old instance.If the number of CDC capture instances for a single table has reached the SQL Server upper limit (2), the trigger may roll back the DDL operation.
If an old CDC change table needs to be retained for OMS to continue consuming, the trigger will move and rename it to an
OMS_BAK_table.Do not manually delete the
OMS_BAK_tables under theoms_sqlserver_cdc_schemaschema unless you are sure OMS has completed consumption. TheOMS_BAK_tables are internal OMS objects and may contain incremental data that has not yet been fully synchronized.
OMS creates triggers, DDL record tables, CDC capture instances, and backup tables in the source database using fixed naming conventions. You do not need to manually maintain these objects.
ObjectNaming conventionDescriptionDDL Trigger oms_cdc_sync_ddlThe trigger name is fixed. Only one OMS DDL trigger is installed per database. Whether to listen for CREATE_TABLEis determined by the script selected during OMS installation.DDL Record Table oms_sqlserver_cdc_schema.oms_cdc_ddl_historyRecords source-side DDL history, including schema name, table name, original DDL SQL, and creation time, for OMS to process schema changes. Synchronization Progress Table oms_sqlserver_cdc_schema.oms_sync_progressRecords the synchronization progress of OMS. The trigger executes OMS-related logic only if this table exists in the source database. CDC Capture Instance OMS_{Schema}_{TableName}_{yyyyMMddHHmmss}For example, OMS_dbo_orders_20260520113000. If the name exceeds SQL Server's length limit, the prefix is truncated while the timestamp is retained.CDC Backup Table oms_sqlserver_cdc_schema.OMS_BAK_{oldCaptureInstance}_{yyyyMMddHHmmss}_{random}A change table retained before switching old CDC capture instances, used by OMS to continue reading old incremental data when consumption lags exist. Note
When troubleshooting issues, business personnel and DBAs can view recent DDL records in
oms_cdc_ddl_historyand check for historical CDC change tables pending cleanup inOMS_BAK_*.During the Stop Forward Synchronization phase of a forward switchover, OMS cleans up the CDC capture instances at the table level of the current link while retaining the CDC-enabled status at the database level. The Process Database Objects phase of a forward switchover follows the same procedure as a link from an Oracle database to the Oracle compatible mode of OceanBase Database, but hidden columns do not need to be dropped. When ending a data migration task, if the task includes incremental synchronization, OMS will simultaneously delete all SQL Server CDC capture instances used by the current link.
Schema migration and incremental DDL convert source object definitions according to the syntax of OceanBase Database's Oracle compatible mode. Known conversion rules are as follows:
Column references in CHECK constraints are converted case by case based on source column metadata and target column mapping; for example,
"Name"in the source is converted to"NAME"in the target. String constants remain unchanged.The default value
DEFAULT '0001-01-01T00:00:00.0000000'for theDATETIME2(7)column is converted toDEFAULT TIMESTAMP '0001-01-01 00:00:00.0000000'in the target, maintaining consistency in date and precision.
If the table structures at the source and target are not identical, data inconsistency may occur. Known scenarios include:
When manually creating a target table structure that exceeds OMS's support scope, implicit conversions may occur, leading to inconsistent column types between the source and target.
If the target field length is shorter than the source field length, data truncation may occur, causing inconsistency between source and target data.
In SQL Server, if the
xmltype contains an empty string ('') or NULL, it is written as NULL after migrating to OceanBase Database's Oracle compatible mode, resulting in data inconsistency between the source and target in this scenario.
When migrating data from SQL Server to OceanBase Database's Oracle compatible mode, table and column names are converted to uppercase by default.
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.
Schema migration and incremental DDL ignore the character set and collation settings of source tables or columns, using the target's default values.
Clock desynchronization between nodes, or between the client and 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, it may cause latency.
As SQL Server is a commercial closed-source database, unexpected issues may arise during incremental synchronization due to log format limitations. Before production deployment, strictly perform a Proof of Concept (POC) test covering business peaks, full business scenarios, table structure adjustments, and complete data verification.
Data type mappings
SQL Server database |
OceanBase Database Oracle mode |
Description |
|---|---|---|
| TINYINT | NUMBER(3, 0) | The value range of TINYINT in SQL Server is [0, 255]. |
| SMALLINT | NUMBER(5, 0) | / |
| INT or INTEGER | NUMBER(10, 0) | / |
| BIGINT | NUMBER(19, 0) | / |
| DECIMAL[(M[,D])] | NUMBER(M,D) or FLOAT(p) | The value range of the target M is [1, 38] and the value range of D is [-84, 127]. FLOAT(p) is a subtype, where the binary precision p ranges from 1 to 126 and is not applicable to non-numeric values. |
| NUMERIC[(M[,D])] | NUMBER(M,D) | The value range of M on the target side is [1, 38], and the value range of D is [-84, 127]. |
| SMALLMONEY | NUMBER(10, 4) | The currency data type in SQL Server stores only the numeric value and does not store the currency symbol. Therefore, it can be mapped to the NUMBER(10,4) data type. |
| MONEY | NUMBER(19, 4) | The currency data type in SQL Server stores only the numeric value, not the currency symbol. Therefore, it can be mapped to NUMBER(19,4). |
| FLOAT[(n)] | NUMBER(M,D) or BINARY_DOUBLE | The value range of n is [1,53]. The value range of BINARY_DOUBLE is from 2.22507485850720E-308 to 1.79769313486231E+308. |
| REAL[(n)] | NUMBER(M,D) or BINARY_FLOAT | The value range of n is [1,24]. The value range of BINARY_FLOAT is from 1.17549E-38F to 3.40282E+38F. |
| BIT | NUMBER(1, 0) | SQL Server's BIT data type has no direct equivalent in OceanBase Database. It is represented by NUMBER(1,0). The source supports the values 0, 1, and NULL. |
| CHAR(n) | CHAR(n) or VARCHAR2(n) or VARCHAR(n) | When n ≤ 2000, it is mapped to CHAR(n). When n > 2000, it is mapped to VARCHAR2(n) or VARCHAR(n). The length range of CHAR is [1,2000], and the length range of VARCHAR2 and VARCHAR is [1,32767]. |
| VARCHAR(n) | VARCHAR2(n) or VARCHAR(n) | The value range of n is [1, 8000], and the value range of the target length is [1, 32767]. |
| VARCHAR(MAX) | CLOB | The maximum size for an SQL Server large object type is 2 GB, while the maximum size for a CLOB in OceanBase Database's Oracle compatible mode is 48 MB. Data exceeding 48 MB cannot be migrated. |
| TEXT | CLOB | Similarly, data exceeding 48 MB cannot be migrated. |
| NCHAR(n) | NCHAR(n) or NVARCHAR2(n) | When n ≤ 256, it is mapped to NCHAR(n); when n > 256, it is mapped to NVARCHAR2(n). The length range for NCHAR is [1,2000], and the length range for NVARCHAR2 is [1,32767]. |
| NVARCHAR(n) | NVARCHAR2(n) | The value range of n is [1, 8000], and the value range of the target length is [1, 32767]. |
| NVARCHAR(MAX) | CLOB | Similarly, data exceeding 48 MB cannot be migrated. |
| NTEXT | CLOB | Similarly, data exceeding 48 MB cannot be migrated. |
| BINARY(n) | RAW(n) or BLOB | The value range of n is [1,8000]. When n ≤ 2000, it is mapped to RAW(n); when n > 2000, it is mapped to BLOB. |
| VARBINARY(n) | RAW(n) or BLOB | Similarly, when n ≤ 2000, it is mapped to RAW(n); when n > 2000, it is mapped to BLOB. |
| VARBINARY(MAX) | BLOB | Similarly, data exceeding 48 MB cannot be migrated. |
| IMAGE | BLOB | Similarly, data exceeding 48 MB cannot be migrated. |
| TIME[(n)] | VARCHAR2(16) | The Oracle compatible mode of OceanBase Database does not have a dedicated TIME type; instead, it maps time text to the VARCHAR2(16) data type. |
| DATE | DATE | In the Oracle compatible mode of OceanBase Database, the DATE type includes a time component. You can use functions to extract only the date part. For reverse incremental writeback to SQL Server, dateThe time, minute, and second fields are lost during columnar storage conversion: After switching, write to the OceanBase Database Oracle compatible mode.DATEhour:minute:second, for writing back to SQL Serverdatewill be lost. For businesses that require reverse incremental migration, only dates should be written to this column, or the field design should be adjusted before the switch (for example, change it todatetime). |
| SMALLDATETIME | TIMESTAMP(0) | / |
| DATETIME | TIMESTAMP(3) | / |
| DATETIME2[(n)] | TIMESTAMP(n) | Retain the source second-level precision n, where n is in the range [0,7]. |
| DATETIMEOFFSET[(n)] | TIMESTAMP(7) WITH TIME ZONE | The source timezone offset range is [-14:00, 14:00]. |
| UNIQUEIDENTIFIER | VARCHAR2(36) | This type of column is only supported during schema migration. Incremental synchronization does not support synchronizing changes to this type of column. |
| XML | XMLTYPE | Schema migration is supported when the target version is V4.2 or later; incremental synchronization is not supported. |
| GEOMETRY | SDO_GEOMETRY | Schema migration is supported when the target version is V4.2.2 or later; incremental synchronization is not supported. |
| GEOGRAPHY | SDO_GEOMETRY | Similarly, schema migration is supported when the target version is V4.2.2 or later, but incremental synchronization is not supported. |
Note
OMS does not support migrating the hierarchyid and sql_variant data types. The uniqueidentifier, xml, geometry, and geography data types are supported only during schema migration and not for incremental synchronization. The cursor and table data types cannot be used to create tables and are therefore not involved in migration. The timestamp (i.e., rowversion) data type is migrated as 8 bytes of binary data. For details, see the "Limitations" section of this topic.
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 must not contain spaces and must not exceed 64 characters in length.
Note
The task name is a unique identifier within the OMS system. Please choose a suitable name.
In the Select Source and Target step, configure the parameters.
ParameterDescriptionSource If you have created an SQL Server 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 parameter details, see Create an SQL Server data source. Target If you have created an OceanBase Database data source in Oracle compatible mode (including physical, public cloud, or standalone data sources), 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 parameter details, 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 details, see Manage data migration tasks by using tags. Click Next. In the Select Migration Type step, select the migration type for the current data migration task.
This process does not support selecting a synchronization topology; only unidirectional synchronization is supported.
Note
This process does not support configuring bidirectional synchronization. To restore data after a business switchover, select Reverse Incremental. For details, see the description of reverse incremental migration in the "Procedure" section of this topic.
Migration Type includes Schema Migration, Full Migration, Incremental Synchronization (DML + DDL), and Reverse Increment (DML + DDL).
Migration TypeUsage RestrictionsSchema Migration After a schema migration task starts, OMS migrates the data object definitions (such as tables, indexes, and constraints) from the source database to the target database and performs type conversion according to the syntax of OceanBase Database's Oracle compatible mode. This process does not support migrating other types of objects, such as views or stored procedures. Full Migration After a full migration task starts, OMS migrates the existing data from the source database tables to the corresponding tables in the target database. If you select Full Migration, we recommend that you collect statistics from the SQL Server database before migrating data. Incremental Synchronization After an incremental synchronization task starts, OMS synchronizes the changed data (inserts, modifications, or deletions) from the source database to the corresponding tables in the target database based on SQL Server's CDC functionality.
Incremental Synchronization includes DML synchronization and DDL synchronization. You can customize the synchronization scope as needed. For details, see Configure DDL/DML synchronization and Synchronize DDL from an SQL Server database to an OceanBase database.Reverse Incremental After a reverse incremental task starts, it can real-time restore the change data generated in the target database after the business switchover back to the source SQL Server database.
Typically, reverse incremental migration reuses the configuration of incremental synchronization, but you can also customize it based on actual needs. Reverse Increment cannot be selected when there is multi-table convergence or when there is a one-to-many schema mapping.
For the DDL synchronization of reverse incremental migration, you can selectcreate,alter,drop,rename,truncatefor the Table category andcreate,dropfor the Index category in Custom Synchronization Scope. The supported DDL scope is different from that of forward incremental synchronization.Notice
The reverse incremental migration of this link (OceanBase Database Oracle compatible mode → SQL Server) does not support synchronizing
DROP INDEX. Even if you selectdropfor the Index category, the target SQL Server will not replay the DDL for dropping the index. Please manually handle the indexes that need to be retained or cleaned up at the source before the business switchover. For other limitations, see "From OceanBase Database to SQL Server Database" in Synchronize DDL from an SQL Server database to an OceanBase database.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 three methods: Specify Objects, import CSV files, and Match by Rule. This topic describes the specific operation for selecting migration objects using the Specify Objects method. For details on configuring matching rules, see Configure matching rules.
Notice
Only tables are supported as migration objects. Tables that do not have a non-null unique key, memory-optimized tables, temporary tables, and compressed tables are not supported. Exclude these types of tables when selecting migration objects.
The names of databases, tables, and columns to be migrated must be in ASCII and cannot contain special characters. For more information, see the "Limitations" section of this topic.
OMS automatically filters out unsupported objects. For information about querying database objects, see Query database objects.
Migration objects are displayed in a hierarchy structure of Database > Table > Table.
In the Select Migration Objects step, select Specify object.
In the Source Object(s) list, select the objects you want to migrate.
Click > to add them to the Target Objects list.
OMS supports renaming target objects, removing them, and setting row filter conditions, selecting partitions, selecting columns, and modifying column name mappings.
Note
When you select migration objects by using the matching rule method, the renaming capability is overridden by the matching rule syntax, and only filter conditions can be set in the operation section. You can modify the matching rule during task execution. For more information, see View and modify migration objects.
OperationStepImport Objects - In the Target Objects list, click Import Objects in the upper-right corner.
- In the dialog box, click Create.
Note:
The import will overwrite previous operation selections. Proceed with caution. - In the Import Migration Objects dialog box, import the objects you want to migrate.
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 validation, click OK.
Rename OMS supports renaming migration objects. For more information, see Rename a database or table. Settings OMS supports configuring row filter conditions, selecting partitions, selecting columns to migrate, and modifying column name mappings. - 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 in 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 Select Columns section, select the columns you want 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.
Click Next. On the Migration Options page, configure the parameters.
Schema migration
The following parameters are displayed only if you select Schema Migration in the Select Migration Type step.
ParameterDescriptionAutomatically proceed to the next stage upon completion When you select schema migration along with any other migration type, you can set 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 table objects after migration. Valid values include Do Not Migrate, Migrate with Schema, and Post-Full-Migration" (This option is displayed only when Full Migration is selected). Note
Clustered indexes, filtered indexes, and unique and non-unique indexes in SQL Server are converted into normal indexes in the Oracle compatible mode of OceanBase Database.
Full migration
The following parameters are displayed only if you select Full Migration in the Select Migration Type step.
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. Configuring resources for the Full-Import component limits the resource consumption during the task's 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 a target table has data, if the original data conflicts with the data to be written, OMS logs the conflicting data and retains the original data unchanged.
- If you select Stop Migration, when a target table has data, an error is reported during full migration, indicating that migration is not allowed. You must handle the data in the target table 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.
</ ul>
Incremental Synchronization
The following parameters are displayed only if you select Incremental Synchronization in the Select Migration Type step.
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. Configuring resources for the Store component limits 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.
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. Configuring resources for the Incr-Sync component limits 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.
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
When the source is an SQL Server database, setting an incremental synchronization start timestamp is not supported. The start timestamp defaults to the time when incremental synchronization starts.
Reverse Incremental
The parameters in this section are displayed only if you select Reverse Increment in the Select Migration Type step. The configuration parameters for reverse incremental are the same as those for incremental synchronization. You can check Reuse Incremental Synchronization Configuration in the upper-right corner.
Before configuring reverse incremental, the user of the source SQL Server database must have the permissions to create objects and update data (
db_ddladminanddb_datawriter). Otherwise, the pre-check will report an error.
If the page's configuration parameters do not meet your needs, you can click Parameter Configuration at the bottom of the page for more specific configuration. OMS supports parameter templates for SQL Server-type Stores. If you have a configured task template or component template, you can also reference it here.
Click Precheck to have the system perform a pre-check on the data migration task.
During the Precheck step, OMS checks whether the database user's read/write permissions, network connectivity, log restore mode and backup status, and SQL Server Agent service status meet the requirements. The data migration task can only be started after all checks pass. If the pre-check reports an error:
You can troubleshoot and resolve the issue, then re-execute the pre-check until it succeeds.
You can also click Skip in the Actions column for the failed pre-check item. A dialog box appears, explaining the specific impact of skipping this operation. After confirming it is okay to skip, 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 data migration task details page, where you can manually start it 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. This link supports Row Count Validation and Full Validation: Row count verification compares the record counts of tables at both ends, while full verification compares the content of the selected data. This link does not support Incremental Validation. Even if incremental synchronization is enabled for the migration task, only the first two verification types can be selected. The validation object only supports tables. For details, see Create a data verification task.
OMS supports modifying migration objects during the execution of a data migration task. For details, see View and modify migration objects. After a data migration task is started, it is executed sequentially according to the selected migration type. For details, see the "View migration details" section in View the details of a data migration task.
Note
When a data migration task includes incremental synchronization, OMS creates a CDC capture instance for the new table before adding it or modifying the matching rules. When a table is removed from the source or target list in the matching rules, OMS also disables the corresponding CDC capture instance.
Notice
If you use matching rules to select migration objects, the original task only selected schema migration + incremental synchronization, and there is a delay in incremental replay, data written to new tables before the new log collection component starts may be missed during the rule expansion, even if the table addition request ultimately succeeds. In this scenario, you must complete the table addition and confirm that incremental collection has started before writing to the new tables. If data has already been written during this period, verify and backfill the differences before using the target tables.