This topic describes the schema migration operations supported in a data migration project in OceanBase Migration Service (OMS).
Background
A schema migration task migrates data objects such as tables, indexes, constraints, comments, and views from the source database to the destination database, and automatically filters out temporary tables. If the source database is not an OceanBase database, OMS automatically converts and encapsulates data types and SQL syntax based on the syntax definition and standard of the tenant type of the destination OceanBase database and then replicates the data to the destination database.
After the precheck succeeds, the data migration project proceeds to the Schema Migration step. On the details page of the data migration project, you can click the Schema Migration tab to view the overall status, start time, end time, and total duration of the schema migration task, as well as the migration progress of tables and views.
If the schema migration task is in the Running or Failed state, the operations that you can perform on a target object varies with the state of the object. If the schema migration task is in the Completed state, you can only view the syntax used to create the target objects.
| Status | Supported operations |
|---|---|
| Initializing | - |
| DDL statements obtained/Creating/Ready | View Creation Syntax |
| Completed/Completed (with conversion)/Skipped | Remove, and View Creation Syntax |
| Failed | Retry, Skip, Remove, View Details, and Modify Creation Syntax |
| Failed to obtain the DDL statement | Retry, Skip, View, and Modify Creation Syntax |
| Not Supported This state occurs when the destination database does not support the creation syntax used in the source database. |
Skip, Remove, View, and Modify Creation Syntax |
Prerequisites
You have created and started a data migration project. For more information, see the topic about creating a data migration project between the corresponding data sources in Data migration.
Limitations
The operations in this topic are applicable to schema migration tasks in the Running or Failed state. If a schema migration task is in the Completed state, you can only view the syntax used to create the target objects.
A schema migration task can migrate tables, indexes, views, comments, and check constraints, but not foreign keys, temporary tables, events, types, functions, or procedures.
Retry a single failed object or all failed objects
You can retry a single object or all objects in the Failed or Failed to obtain the DDL statement state. You can directly retry an object, or retry an object after you modify it.
Retry a single failed object: On the Schema Migration page, find the failed object and click Retry in the Actions column.
Retry all failed objects
On the Schema Migration page, click Retry All Failed Objects in the upper-right corner.
In the dialog box that appears, click OK.
Skip a target object
You can skip a target object in the Failed, Failed to obtain the DDL statement, or Not Supported state.
Notice
- You must prepare a corresponding migration object in the destination database before you skip the target object. Otherwise, an error will occur in the Full Migration step.
- Once skipped, the target object will not be migrated in the current data migration project. Proceed with caution.
On the Schema Migration page, find the target object and click Skip in the Actions column.
In the dialog box that appears, click OK.
On the Schema Migration page, find the target object and click Remove in the Actions column.
In the dialog box that appears, click OK.
On the Schema Migration page, find the target object and choose More > Modify in the Actions column.
In the Modify Table Creation Syntax dialog box, check the failed DDL statement and the error message, and modify the definition of the conversion result of the DDL statement.
Click Save.
On the Schema Migration page, find the target object and choose More > View Details in the Actions column.
In the View Details dialog box, view the cause of the failure.
To skip a target object, perform the following operations:
Remove a target object
You can remove a target object in the Failed, Completed, Completed (with conversion), Skipped, Failed to obtain the DDL statement, or Not Supported state.
Notice
Once removed, the target object will not be migrated in the current data migration project. Proceed with caution.
Modify the creation syntax
You can modify the table creation syntax of a target object in the Failed or Failed to obtain the DDL statement state.
View the creation syntax
You can view the table creation syntax of all target objects except those in the Initializing or Failed state.
On the Schema Migration page, find the target object and click View in the Actions column. Fully compatible DDL syntax executed on the OBServer node is directly displayed. Incompatible syntax is converted before it is displayed.
View details of a failed object
You can view the error details of a target object in the Failed state.