This topic describes how to rename a migration or synchronization object in OceanBase Migration Service (OMS).
Application scenarios
By default, a migrated or synchronized object, such as a database or table, has the same name at the source and destination. OMS allows you to rename a migrated or synchronized object at the destination to implement mappings of database names and table names between the source and destination. The renaming feature usually applies to multi-table aggregation scenarios and scenarios where the object names in the test and production environments are inconsistent.
Note
The multi-table aggregation feature is mainly used to synchronize sharded data from DRDS and MyCat data sources to the same table in the destination database.
Limitations
OMS allows you to rename a migration or synchronization object only in the step of selecting migration or synchronization objects when you configure a data migration or synchronization project.
After a data migration or synchronization project is started, do not rename migration or synchronization objects. Otherwise, the project may fail.
In data synchronization scenarios, you can rename a specified object only when you synchronize data from an ODP logical table to a physical table of a MySQL tenant of OceanBase Database, or from an IDB logical table to a MySQL tenant of OceanBase Database.
Rename a specified object
When you select migration or synchronization objects by using the Specify Objects option, you can perform the following operations to rename a specified object:
Configure the data migration or synchronization project to the Select Migration Objects or Select Synchronization Objects step.
For more information, see the documentation of data migration or data synchronization projects of the corresponding type.
Select migration or synchronization objects by using the Specify Objects option. Then, in the Destination Object list in the Specify Migration Scope or Specify Synchronization Scope section, hover over the target table object and click Rename.
Enter the new name of the object at the destination.
Click OK. Then, you can view the new name of the object.
Complete subsequent project settings as prompted.
Rename an object based on rule matching
When you select migration objects by using the Match Rules option, you can perform the following operations to rename an object:
Notice
You can rename only a migration object based on rule matching.
After you rename a destination object by using an object migration rule on the left, you cannot rename this object again on the right. The row filter conditions and other settings remain the same after the renaming operation.
Configure a data migration project to the Select Migration Objects step.
For more information, see the documentation of data migration projects of the corresponding type.
Select migration objects by using the Match Rules option. Then, enter the renaming equation in the Object Migration Rule field in the Specify Migration Scope section. In the Object Migration Rule field, you can use an equal sign (=) to clear the mapping between the source and destination and rename an object. For example, assume that a source database is named
testand a source table is namedtest1. You can entertest.test1=a.bto rename the database asaand the table asb.Click Verify.
After the verification succeeds, click Preview Object to view the new database name and table name.
Complete subsequent project settings as prompted.