When configuring a data migration task, you can use migration data filters to filter data records in the source table object by extracting records that fulfill specified conditions. This is applicable to scenarios such as regular incremental data replication and table splitting.
This document describes how to configure Where clauses in SQL for filtering migration data.
SQL filtering clauses only apply to existing data migration and do not affect the incremental data.
The SQL filtering function can be called during the Migration object and type configuration stage, within the creation of a migration task. It is used for specific table objects rather than database objects.
Follow these steps to configure SQL filtering clauses:
Select the table object to be migrated in the Migration objects box, and add it to the Selected objects box.
Click Edit under the newly added table object that you want to configure SQL filtering clauses.
Note: The Edit button appears when the mouse is over the specific object in the Selected objects box.
On the Edit table page, enter the SQL Where clause in the Filtering condition block, and click Verify syntax.
The SQL Where clause follows the standard database SQL Where syntax, supporting calculation and simple functions. For example, you can use the clause
id>1000to migrate records with ID numbers greater than 1,000.
Click OK to complete.
After the SQL filtering configuration, the data migration task only migrates tables with records that fulfill the specified conditions.