Help Center/ Data Admin Service/ User Guide/ RDS for MariaDB/ Table Structure Comparison and Synchronization (Not Promoted)
Updated on 2024-11-28 GMT+08:00

Table Structure Comparison and Synchronization (Not Promoted)

This section describes how to check the structure difference by comparing and synchronizing table structures when you perform a migration or verification.

Precautions

To create a table structure comparison and synchronization task, you need to toggle on Save SQL first so that DAS can store your data. If you do not toggle on it, you cannot create table structure comparison and synchronization tasks.

Procedure

  1. Log in to the DAS console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner, and under Databases, click Data Admin Service.
  4. In the navigation pane on the left, choose Development Tool.

    You can also click Go to Development Tool on the overview page.

  5. Locate the DB instance that you want to log in to and click Log In in the Operation column.
  6. On the top menu bar, choose Structure Management > Table Structure Comparison and Synchronization.

    Search for tasks by status and view task details.

  7. On the displayed page, click Create Task in the upper left corner.

    Figure 1 Creating a table structure comparison and synchronization task

  8. On the displayed page, configure required parameters and click Next.

    Table 1 Parameter description

    Parameter

    Description

    Source Instance

    The DB instance that you have logged in to by default.

    Source Database

    Select a source database.

    Target Instance

    Select Current instance or Another instance.

    Target Database

    Select a target database to be compared with.

    Error Tolerance

    Configuring this parameter is recommended.

    After this parameter is configured, if a comparison or synchronization error occurs during task execution, the system ignores the error and continues the execution.

    Sync Type

    • Global: synchronizes all tables with the same name from the source database to the target one.
    • Specified: synchronizes specific tables with the same name from the source database to the target one.
    • One-to-one: allows you to specify a source table and target table for synchronization. The two tables can have different names.
    • One-to-more: synchronizes the structure of a table in the source database to multiple tables in the target database. This option is usually selected when you want to change table structures during database and table sharding.

  9. Click Next to go to the Compare page, check task information and comparison items, and click Compare.

    You can also select the items you want to skip and click Skip to cancel the comparison.

    Figure 2 Setting comparison items

  10. View comparison progress.

    In the comparison item list, click View Logs in the Operation column to obtain comparison details. You can also click Download DDL as needed.

    Figure 3 Viewing comparison progress

  11. After comparison is complete, click Next. On the Synchronize page, view basic information about this comparison task, such as the source instance, source database, target instance, target database, and synchronization type, and in the synchronization item list, specify the items to be synchronized.

    Skip synchronization items that may cause high risks and then click Synchronize.

    Figure 4 Synchronizing data

  12. After synchronization is complete, click View Logs in the Operation column to obtain comparison details.

    You can download DDL as required.