Task Stages |
By default, Incremental Data Synchronization is selected. You must also select Schema Synchronization and Full Data Synchronization. After the precheck is complete, DTS synchronizes the historical data of the selected
objects from the source database to the destination database. The historical data
is the basis for subsequent incremental synchronization.
Note If Full Data Synchronization is selected, you can synchronize the schema and data of the table that is created
by executing the CREATE TABLE statement to the destination database.
|
Processing Mode of Conflicting Tables |
-
Precheck and Report Errors: checks whether the destination database contains tables that have the same names
as tables in the source database. If the source and destination databases do not contain
tables that have identical table names, the precheck is passed. Otherwise, an error
is returned during the precheck and the data synchronization task cannot be started.
Note You can use the object name mapping feature to rename the tables that are synchronized
to the destination database. You can use this feature if the source and destination
databases contain identical table names and the tables in the destination database
cannot be deleted or renamed. For more information, see Map object names .
- Ignore Errors and Proceed: skips the precheck for identical table names in the source and destination databases.
Warning If you select Ignore Errors and Proceed, data inconsistency may occur and your business may be exposed to potential risks.
- If the source and destination databases have the same schemas, and a data record has
the same primary key as an existing data record in the destination database:
- During full data synchronization, DTS does not synchronize the data record to the
destination database. The existing data record in the destination database is retained.
- During incremental data synchronization, DTS synchronizes the data record to the destination
database. The existing data record in the destination database is overwritten.
- If the source and destination databases have different schemas, data may fail to be
initialized. In this case, only some columns are synchronized or the data synchronization
task fails.
|
DDL and DML Operations to Be Synchronized |
The DDL and DML operations that you want to synchronize. For more information, see
SQL operations that can be synchronized.
Note To select the SQL operations performed on a specific database or table, right-click
an object in the Selected Objects section. In the dialog box that appears, select the SQL operations that you want
to synchronize.
|
Merge Tables |
- Yes: In online transaction processing (OLTP) scenarios, sharding is implemented to speed
up the response to business tables. In online analytical processing (OLAP) scenarios,
you can store a large volume of data in a single table. This makes your SQL queries
more efficient. You can merge multiple source tables that have the same schema into
a single destination table. This feature allows you to synchronize data from multiple
tables in the source database to a single table in the destination database. For more
information, see Enable the multi-table merging feature.
Note
- After you select multiple tables from the source database, you must change the names
of these tables to the name of the destination table. To do this, you can use the
object name mapping feature. For more information, see Map object names .
- DTS adds a column named
__dts_data_source to the destination table. This column is used to record the data source. The data
type of this column is TEXT. DTS specifies the column values based on the following
format: <DTS instance ID>:<Database name>:<Schema name>:<Table name> . Such column values allow DTS to identify each source table. For example, dts********:dtstestdata:testschema:customer1 indicates that the source table is customer1.
- If you set this parameter to Yes, all the selected source tables in the task are merged
into a single destination table. If you do not need to merge specific source tables,
you can create a separate data synchronization task for these tables.
Warning We recommend that you do not perform DDL operations to change the schemas of source
databases or tables. Otherwise, data inconsistency may occur or the data synchronization
task fails.
- No: This value is selected by default.
|
Capitalization of Object Names in Destination Instance |
The capitalization of database names, table names, and column names in the destination
instance. By default, DTS default policy is selected. You can select other options to make sure that the capitalization of
object names is consistent with that in the source or destination database. For more
information, see Specify the capitalization of object names in the destination instance.
|
Source Objects |
Select one or more objects from the Source Objects section and click the icon to add the objects to the Selected Objects section.
Note
- You can select columns, tables, or databases as the objects to be synchronized. If
you select tables or columns as the objects to be synchronized, DTS does not synchronize
other objects such as views, triggers, or stored procedures to the destination database.
- If you select a database as the object to be synchronized, DTS synchronizes data based
on the following default rules:
- If the table to be synchronized in the source database has a primary key, such as
a single-column primary key or a composite primary key, the primary key columns are
specified as the distribution keys.
- If the table to be synchronized in the source database does not have a primary key,
an auto-increment primary key column is automatically generated in the destination
table. This may cause data inconsistency between the source and destination databases.
|
Selected Objects |
- To rename an object that you want to synchronize to the destination instance, right-click
the object in the Selected Objects section. For more information, see Map the name of a single object.
- To rename multiple objects at a time, click Batch Edit in the upper-right corner of the Selected Objects section. For more information, see Map multiple object names at a time.
Note
- To select the SQL operations performed on a specific database or table, right-click
an object in the Selected Objects section. In the dialog box that appears, select the SQL operations that you want
to synchronize. For more information about the SQL operations that can be synchronized,
see SQL operations that can be synchronized.
- To specify WHERE conditions to filter data, right-click an object in the Selected Objects section. In the dialog box that appears, specify the conditions. For more information,
see Use SQL conditions to filter data.
|