This topic describes the wildcard rules supported by the OceanBase Migration Service feature.
Background
A wildcard pattern is similar to a regular expression. The OMS feature supports the following wildcard patterns: "*", "?","[]", and "[!]". The rules to include or exclude migration objects are case-sensitive. A rule is hit only when the name of the source object exactly matches the rule, including the case.
After you configure the object migration and exclusion rules, a new table created in the source database can be synchronized by the OMS feature in real time if the table name matches the migration rule and does not match the exclusion rule. The <source database>.*=<destination database>.<table name> string indicates that all tables in the source database are mapped to one table in the destination database. In other words, if we represent that string as a.b=c.d, we can use wildcards only for b, while a, c, and d are specific names of databases and tables.
Asterisk (*)
You can use an asterisk to match a string of characters in any length. It can also be an empty character. For example, if you set Object Migration Rule to <Schema>.*, all tables and views in the specified schema are displayed on the Matching Result tab in the right-side panel.
In the Object Exclusion Rule field, you can set the objects that do not need to be migrated, and then click Verify . After verification is passed, click Preview Objects and view the objects on the Matching Result tab.
Question mark (?)
You can use a question mark to match a single character. To match more than one character, use multiple consecutive question marks. For example, if you set Object Migration Rule to <Schema>.t?, tables and views that conform to the format in the specified schema are displayed on the Matching Result tab in the right-side panel. Important
You cannot use a question mark to match an empty character. In other words, the place held by the question mark must have a character.
In the Object Exclusion Rule field, you can set the objects that do not need to be migrated, and then click Verify . After verification is passed, click Preview Objects and view the objects on the Matching Result tab.
Brackets ([])
You can use a pair of brackets to include any characters that must be matched, or use [start-end] to match a continuous range. For example, if you set Object Migration Rule to <Schema>.[]*, tables and views that conform to the format in the specified schema are displayed on the Matching Result tab in the right-side panel.
In the Object Exclusion Rule field, you can set the objects that do not need to be migrated, and then click Verify . After verification is passed, click Preview Objects and view the objects on the Matching Result tab.
An exclamation point enclosed with brackets ([!])
You can use this wildcard pattern to match any non-empty characters that are not enclosed in the brackets or use [!start-end] to indicate a continuous range. For example, if you set Object Migration Rule to <Schema>.[!]*, tables and views that conform to the format in the specified schema are displayed on the Matching Result tab in the right-side panel.
In the Object Exclusion Rule field, you can set the objects that do not need to be migrated, and then click Verify . After verification is passed, click Preview Objects and view the objects on the Matching Result tab.