tencent cloud

Feedback

Creating Data Consistency Check Task

Last updated: 2024-01-15 14:49:55

    Overview

    During data consistency check, DTS compares the collection data between the source and target databases and outputs the comparison result and inconsistency details for you to determine the business cutover time. A data consistency check task is independent of the normal business in the source database or other DTS tasks.
    Data consistency check tasks can be triggered automatically or created manually.
    Automatic triggering: During migration task configuration, if Full check is selected for Data Consistency Check, a data consistency check task will be triggered automatically when the migration task enters the incremental sync step.
    Manual creation: When the DTS task enters the incremental sync step, you can manually create one or multiple data consistency check tasks.

    Note

    Data consistency check compares only the objects selected in the source database and objects migrated to the target database. If you write data into the target database during migration, then the written data will not be included in the consistency check.
    A data consistency check task may increase the load in the source database instance. Therefore, you need to perform such tasks during off-peak hours.
    A data consistency check task can be executed repeatedly, but one DTS instance can initiate only one such task at any time.
    If you choose to complete or terminate a DTS task before a data consistency check task is completed, the check task will fail.
    As data consistency check requires creating a new database __tencentdb__ in the source database and writing the checksum collection to the database, if the source database is read-only, data consistency check will be skipped.

    Restrictions

    Currently, check tasks are imperceptible to the DDL operations. If you perform DDL operations in the source database during migration, the check result will be inconsistent with the actual data, and you need to initiate another check task to get the accurate comparison result.

    Triggering a data consistency check task automatically

    On the Set migration options and select migration objects page of a data migration task, select Full check for Data Consistency Check. In this way, a data consistency check task will be triggered automatically when the migration task enters the incremental sync step.
    Note:
    In this case, the full data and all the database information will be checked by default. If you need to filter check objects, create a data consistency check task manually.
    

    Creating a data consistency check task manually

    1. Log in to the DTS console.
    2. On the Data Migration page, select the target migration task and click More > Create Data Consistency Check Task in the Operation column.
    
    3. On the Database Consistency Check page, click Create Data Consistency Check Task.
    Note:
    A data consistency check task can be created only when the corresponding DTS task is in the incremental sync step. If the button is grayed out, the DTS task status does not meet the requirement; for example, the task has not entered the incremental sync step, has failed, or is terminated.
    
    4. In the Notes pop-up window, read the notes, confirm the check task to be initiated, and click OK.
    5. Configure the following parameters in the Create Data Consistency Check Task window and click Create and Start Consistency Check Task.
    
    Parameter
    Description
    Configuration Method
    Task Name
    Set the check task name.
    You can enter any characters as the task name to facilitate task management.
    Object Migration Mode
    Specify the database check mode.
    It is fixed at Entire instance.
    Check Object
    Select the migrated object check method.
    All migration objects: All the migrated data will be checked.
    Custom: In the Source Database Object area below, select the databases/collections to be checked.
    Database Information
    Select the database information to be checked, which can be Index, Database and , or Shard key.
    For sharded clusters, you can choose to check the shard key.
    Data Check
    Select the data check method.
    Row count check: It compares the number of rows of data in the source and target databases.
    Content check: It compares the data content in the source and target databases row by row.
    If the data volume is high, we recommend that you select Row count check. If you select Content check, extract a relatively low proportion of data for check to improve the check efficiency.
    Sampling
    If you select Content check and the data volume is high, you can sample a proportion of data for comparison.
    Select this option as needed based on your business conditions.

    Viewing the data consistency check result

    1. In the data migration task list, view whether the check result is Consistent or Inconsistent in the Last Check Result column. Click View More to enter the Data Consistency Check page.
    2. In the data check task list, select a task and click View in the Operation column to view the check result.
    
    If the data is consistent, the result is like this:
    
    If the data is inconsistent, the result is like this:
    Note:
    For inconsistent data, you need to manually confirm the corresponding data content of the source and target databases as prompted.
    

    References

    For more information, see Technical Scheme and Common Problems of Data Consistency Check.
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support