All Products
Search
Document Center

Data Management:Repair table inconsistency

Last Updated:Sep 11, 2023

Data Management (DMS) provides the table inconsistency repair feature. This feature allows you to compare the schemas of tables, identify schema differences, and generate SQL statements to be executed for the destination table. This ensures schema consistency between different tables.

Scenarios

  • Compare the schemas of a table in different environments, such as the test environment and production environment, to repair schema inconsistency.
  • Select a table as the base table and create physical or logical tables based on the schema of this table.
  • Repair schema inconsistency between tables in different databases.
  • Apply the changes of a specific physical table to each table in a logical database at a time.

Procedure

  1. Log on to the DMS console V5.0.
  2. In the top navigation bar, choose Database Development > Schema Change > Table Consistency Repairing.

    Note

    If you use the DMS console in simple mode, move the pointer over the 2022-10-21_15-25-22.png icon in the upper-left corner of the DMS console and choose All functions > Database Development > Schema Change > Table Consistency Repairing.

  3. Complete the Table/Database Synchronization Application wizard. The following table describes the parameters involved.
    ParameterDescription
    Base Database(Physical Database)
    1. Select the source database for table inconsistency repair. You can enter a keyword of the database name in the Base Database(Physical Database) field to search for the database.
    2. Optional: Select a schema version number of the database. By default, the latest schema is used. For more information about schema version numbers, see Manage schema versions
    Note
    • You can select only a physical database as the source database.
    • You must have the query permissions on the source database. For more information, see Manage permissions.
    Target Database
    1. Select the destination database for table inconsistency repair. You can enter a keyword of the database name in the Target Database field to search for the database.
    2. Optional: Select a schema version number of the database. By default, the latest schema is used. For more information about schema version numbers, see Manage schema versions
    Note
    • You can select a physical database or a logical database as the destination database.
    • You must have permissions to alter tables in the destination database. For more information, see Manage permissions.
    Repaired Table
    • Enter the name of the base table or select the table from the drop-down list on the left side.
    • Enter the name of the destination table or select the table from the drop-down list on the right side.
      Note
      • You can select a physical table, a logical table, or an aggregate table as the destination table.
      • If the specified destination table exists, DMS compares the schemas of the base table and the destination table and executes the generated SQL statements to repair schema inconsistency.
      • If the specified destination table does not exist, DMS automatically creates the table.

        The security rule named Enable execution capability (if closed, other rules are invalid) must be enabled for the destination database. For more information, see Table synchronization.

    Whether to Ignore ErrorSpecifies whether to skip errors that occur when SQL statements are being executed. Valid values:
    • Not Ignore: If an error occurs when SQL statements are being executed, DMS stops executing the current and subsequent SQL statements.
    • Ignore: If an error occurs when SQL statements are being executed, DMS skips the current SQL statement and continues to execute subsequent SQL statements until all remaining statements are executed.
    Business Background(Remarks)The business background of the repair operation, such as the purposes or objectives.
  4. Click Submit.
    DMS starts to analyze the schemas.
  5. Click Submit for Approval.
  6. After the application is approved, click Submit and Synchronize to Target Database.