All Products
Search
Document Center

Repair table consistency

Last Updated: May 09, 2020
  • Schemas of the same table may be inconsistent in two environments, such as the test environment and the production environment. To resume the schema consistency, you need to compare schemas in the two environments, find differences, and run SQL statements in the environment in which you want to modify the schema.
  • This feature applies to many scenarios. For example, you can use this feature to resume the schema consistency in the following scenarios:
    • Between the test environment and the production environment.
      • In this case, you need to ensure the schema consistency between physical tables.
    • Between a physical database and a logical database.
      • In this case, you need to ensure the schema consistency between physical tables and logical tables. For example, you need to replicate data changes in a physical database to each physical database in a logical database.

Procedure

This topic takes the schema consistency between a physical database and a logical database as an example. This requires you to ensure the schema consistency between physical tables and logical tables.

Background:

  • The physical database contains a physical table test_logic_table_0000.
  • You want to create a logical table test_logic_tableA_[0000-0015] that contains 16 physical tables in the logical database.
  1. Create a ticket.

    • Source Database: Select a physical database. Make sure that you have the permission to query the source database. You can only select one physical database.
    • Target Database: Select a logical database. Make sure that you have the permission to change data in the target database. You can select a physical database or a logical database.
    • Repaired Table: (You can resume the schema consistency of a pair of tables or multiple pairs of tables at a time.)
      • Base Table Name: Select a table from the drop-down list.
      • Target Table Name: Enter the logical table name expression as required.
  2. Submit a ticket.

  3. View basic information about the ticket.

  4. View the schema comparison result.

  5. Resume schema consistency.

    If database and table synchronization is enabled in the security rule for the target database, DMS Enterprise starts to resume the schema consistency when the ticket is approved.