This topic describes the operations supported for schema migration in a data migration task of OceanBase Migration Service (OMS).
Background information
Schema migration is responsible for migrating data object definitions (such as tables, indexes, constraints, comments, and views) from the source database to the target database, and automatically filters out temporary tables. When the source database is not an OceanBase database, it automatically converts and assembles data types and SQL syntax according to the syntax definition standards of the target OceanBase tenant type, and then replicates them to the target database.
When the target is in OceanBase Database's Oracle compatible mode, OMS migrates column comments from the source table: for target versions V4.4.2.2 and later, adding comments to columns is supported within the CREATE TABLE statement, where column comments are created together with the table creation statement; for versions earlier than V4.4.2.2, they are added via a separate COMMENT ON COLUMN statement.
After passing the pre-check, a data migration task enters the Schema Migration step. You can go to the details page of the data migration task and click the Schema Migration tab to view the overall status, start time, end time, total duration, and migration progress of tables and views.
When a schema migration task is in the Running or Failed state, you can perform different operations on target objects in these states, as shown in the following table. When a schema migration task is in the Completed state, you can only view the creation syntax of the target objects.
Status |
Supported operations |
|---|---|
| Initializing | - |
| Obtaining DDL Success, Creation in Progress, and Ready | View the creation syntax. |
| Completed, Completed (with conversion), and Skipped | Remove and View Creation Syntax |
| Failed | Retry, skip, remove, view error details, and modify the creation syntax |
| Failed to obtain DDL statements. | Retry, skip, view, and modify the creation syntax |
This status typically occurs when the source has a creation syntax that is not supported by the target. |
Skip, remove, view, and modify the creation syntax |
Prerequisites
You have created and started a data migration task. For details, see the corresponding type of document on creating a data migration task in the Data Migration module.
Limitations
The schema migration operations described in this topic apply to schema migration tasks in the Running or Failed state. For tasks in the Completed state, you can only view the creation syntax of the target objects.
Schema migration supports migrating tables, indexes, views, comments, and CHECK constraints. When the target is OceanBase Database in Oracle compatible mode and the source is an Oracle database or OceanBase Database in Oracle compatible mode, it also supports migrating objects such as sequences, types, stored procedures, functions, packages, triggers, and synonyms. For details, see Data migration between OceanBase databases.
Schema migration does not support migrating temporary tables, events, or other objects or constraints.
Retry/Retry all failed objects
Target objects in the Failed or Failed to obtain the DDL statement. state can be retried individually or all at once. You can retry directly or modify the objects before retrying.
Retry a single failed object: On the Schema Migration page, click Retry in the Actions column of the failed object.
Retry all failed objects
On the Schema Migration page, click Retry All Failed Objects in the upper-right corner.
In the dialog box, click OK.
Skip target objects
Target objects in the Failed, Failed to obtain the DDL statement., or Not Supported state can be skipped.
Note
- The prerequisite for skipping an operation is that you have prepared the corresponding migration objects at the target. If the migration object does not exist at the target and you skip it here, an error will be reported during the Full Migration step.
- Once an object is skipped, it cannot be re-initiated. Proceed with caution.
To skip a target object, perform the following steps:
On the Schema Migration page, click Skip in the Actions column of the target object.
In the dialog box, click OK.
Remove a target object
You can remove target objects in the Failed, Completed, Completed (with conversion), Skipped, Failed to obtain the DDL statement., or Not Supported state.
Notice
After an object is removed, it will no longer be migrated in the current data migration task. Proceed with caution.
On the Schema Migration page, click Remove in the Actions column of the target object.
In the dialog box, click OK.
Modify table creation syntax
You can modify the creation syntax of a target object in the Failed or Failed to obtain the DDL statement. state.
On the Schema Migration page, click More > Modify in the Actions column of the target object.
In the Modify Table Creation Syntax dialog box, check the failed DDL and errors, and modify the definition of the DDL conversion result.
Click Save.
View the creation syntax
On the Schema Migration page, click View in the Actions column of the target object to view its creation syntax.
Note
Target objects in all states except Initializing and Failed support viewing their creation syntax.
If the table creation syntaxes are fully compatible, the DDL syntax executed on the OBServer node is displayed. If they are not fully compatible, the transformed creation syntax is displayed.
View details of failed objects
You can view error details for target objects in the Failed state.
On the Schema Migration page, click View Details in the Actions column of the target object.
In the View Details dialog box, view the reason for the failure.