During data consistency check, DTS compares the table data between the source and target databases and outputs the comparison result and inconsistency details for you to quickly process the inconsistent data. A data consistency check task is independent and does not affect the normal business in the source database or other DTS tasks.
A data consistency check task can be created only when the corresponding DTS task is in the incremental sync step.
Currently, data consistency check is supported only for migration from self-built MySQL, TencentDB for MySQL, and third-party MySQL to TencentDB for MySQL/TDSQL-C.
- Data consistency compares only data migrated from the source database 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. 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.
- A table to be checked must have a primary key or unique key; otherwise, it will be skipped by DTS during the check.
- If you choose to complete or terminate a DTS task before a data consistency check task is completed, the check task will fail.
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.
Creating data consistency check task
- Log in to the DTS console.
- On the Data Migration page, select a migration task you want to check and click the task ID to enter the Task Details page.
- Switch the tab and click Data Consistency Check.
- Click Create Data Consistency Check.
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.
- In the pop-up window, click OK.
- After configuring the data consistency check parameters, click Start Data Comparison.
You can select All Migration Objects or Custom for the migration objects.
Viewing data consistency check result
- On the migration task homepage, click View More in the Last Check Result column.
- Click View to view the check result.
If the data is consistent, the result will be like: