Skip to main content

Schema comparison

NineData Schema Comparison checks whether object definitions are consistent between two databases. Use it to compare database metadata, such as table definitions, before or after migration, synchronization, or cutover validation.

Before you begin

Procedure

  1. Sign in to the NineData Console.

  2. In the navigation pane, click Database Comparison > Schema Comparison.

  3. On the Schema Comparison page, click Create Schema Comparison.

  4. On the Source & Target tab, configure the parameters in the table, and click Next.

    Parameters
    Description
    NameEnter a name for the comparison task. Use a meaningful name for later search and management. The name can contain up to 64 characters.
    SourceSelect the source data source. NineData uses the structure of this data source as the baseline for comparison.
    TargetSelect the target data source to compare with the source.
    FrequencySelect how often the comparison runs.
    • One-time: Run the comparison task once. Run the comparison manually again later if required.
    • Periodic: Run the comparison task on a recurring schedule.
    Periodic (Periodic comparison only)Select the comparison schedule. Select one or more days from Monday to Sunday, or select Every day to run the comparison daily.
    Time Zone (Periodic comparison only)Select the time zone for the task. This setting affects the time displayed for the comparison task.
    Launch Time (Periodic comparison only)Select the time when the comparison task starts. The available range is 00:00 to 23:59. Click Now to use the current time as the start time.
  5. On the Objects tab, select the objects to compare, and click Next. Both Full Instance and Customized Object are supported.

  • Full Instance: Select all databases and objects in the source instance.
  • Customized Object: Select specific databases and objects. In the Source list, select the databases and objects to compare, and click > to add them to the Target list.
  1. On the Mapping tab, configure mappings between source and target database or object names, and click Save and Pre-Check.

    tip

    If database or object names differ between the source and target, configure mappings before starting the comparison.

  2. On the Pre-check tab, wait for NineData to complete the pre-check. After the pre-check passes, click Launch.

    tip
    • If the pre-check fails, click Details in the Actions column for the failed check item, review and fix the issue, and run the pre-check again.
    • For warnings, review the message and decide whether to fix the item or continue.
  3. On the Launch tab, wait for the Launch Successfully message. Then choose one of these actions:

  • For a Periodic comparison task, click Compare to run a comparison immediately.
  • Click View Details to open the task execution details.
  • Click Back to List to return to the Schema Comparison list.

Result

The schema comparison task is created and runs based on the selected frequency. Open the task details page to view comparison progress, logs, inconsistent object definitions, generated SQL, and historical comparison results.

View comparison results

  1. Sign in to the NineData Console.

  2. In the navigation pane, click Database Comparison > Schema Comparison.

  3. On the Schema Comparison page, click the Task ID of the target comparison task.

    Schema comparison task details

    No.
    Section
    Description
    1Task statusDisplays the current status of the comparison task.
    2Configure alertsSends notifications through the configured notification method when the task fails.
    3Compare nowDisplayed for tasks that are not currently running. Starts a comparison immediately.
    4MoreProvides task actions.
    • Pause: Pause a task. This applies only to tasks whose status is Running.
    • Edit: Edit task configuration.
    • Terminate: End the task.
    • Delete: Delete the task. This action is irreversible. Proceed with caution.
    5Filter itemsFilter comparison results by object type, task status, task results, and object name.
    6LogDisplays logs generated during task execution. Filter logs by log type, log generation time, keywords, and other items.
    7RefreshRefreshes the latest comparison task status.
    8List of comparison resultsDisplays schema comparison results between the source and target.
    • Click the Details icon in the Actions column to view DDL comparison details for the source and target.
    • Click the SQL icon in the Actions column for an inconsistent result to generate SQL that can be applied to the target data source to fix the inconsistency.
    9History of comparison task resultsDisplays historical comparison results. Click a result to open its details.