Precautions and limits for synchronizing data from a Db2 for LUW database

更新时间:
复制 MD 格式

Before you synchronize data from a Db2 for LUW database, review the following precautions and limits to ensure that your data synchronization task runs as expected.

Synchronize data from a Db2 for LUW database to a PolarDB-X V2.0 instance

Note

By default, Data Transmission Service (DTS) disables foreign key constraints for the destination database during data synchronization. As a result, cascade and delete operations on the source database are not synchronized to the destination database.

Limit type

Description

Limits on the source database

  • The server that hosts the source database must have sufficient outbound bandwidth. Otherwise, the data synchronization speed decreases.

  • The tables to be synchronized must have PRIMARY KEY or UNIQUE constraints, and all fields must be unique. Otherwise, the destination database may contain duplicate data records.

  • If you select tables as the objects to be synchronized and you want to modify the tables in the destination database, such as renaming tables or columns, you can synchronize up to 5,000 tables in a single task. If you synchronize more than 5,000 tables, a request error occurs. In this case, we recommend that you split the tables across multiple tasks or synchronize the entire database.

  • The data logging feature must be enabled. Otherwise, error messages are returned during precheck, and the data synchronization task cannot be started.

    Note

    If you perform only incremental data synchronization, the data logs of the source database must be retained for more than 24 hours. If you perform both full and incremental data synchronization, the data logs must be retained for at least seven days. Otherwise, DTS may fail to obtain the data logs and the task may fail. In exceptional circumstances, data inconsistency or loss may occur. After full data synchronization is complete, you can set the retention period to more than 24 hours. Make sure that you set the retention period based on these requirements. Otherwise, the service reliability or performance stated in the Service Level Agreement (SLA) of DTS cannot be guaranteed.

  • The change data capture (CDC) feature must be enabled for the tables to be synchronized.

  • Do not run DDL operations that change database or table schemas during schema synchronization or full synchronization. Otherwise, the synchronization task fails.

    Note

    During full synchronization, DTS queries the source database. This creates metadata locks that may block DDL operations on the source database.

Other limits

  • DTS synchronizes incremental data from a Db2 for LUW database to the destination database based on the CDC replication technology of Db2 for LUW. The CDC replication technology has its own limits. For more information, see General data restrictions for SQL Replication.

  • Evaluate the impact of data synchronization on the performance of the source and destination databases before you start. We recommend that you synchronize data during off-peak hours. During initial full data synchronization, DTS uses read and write resources of the source and destination databases, which may increase the load on the database servers.

  • During initial full data synchronization, concurrent INSERT operations cause fragmentation in the destination tables. After full data synchronization is complete, the used tablespace of the destination database is larger than that of the source database.

  • During data synchronization, we recommend that you use only DTS to write data to the destination database to prevent data inconsistency. After data synchronization is complete, you can use Data Management (DMS) to execute DDL statements online. For more information, see Perform lock-free DDL operations.

  • If a task fails, DTS support staff will attempt to restore it within eight hours. During restoration, they may restart the task or adjust its parameters.

    Note

    Only DTS task parameters are modified—not database parameters. Parameters that may be adjusted include those listed in Modify instance parameters.

Special cases

The source Db2 for LUW database is a self-managed database. When you synchronize data from the Db2 for LUW database, note the following items:

  • If you perform a primary/secondary switchover on the source database while the data synchronization task is running, the task fails.

  • DTS calculates synchronization latency based on the timestamp of the latest synchronized data record in the destination database and the current timestamp in the source database. If no data manipulation language (DML) operation is performed on the source database for a long time, the synchronization latency may be inaccurate. If the synchronization latency is too high, you can perform a DML operation on the source database to update the latency.

    Note

    If you select an entire database as the object to be synchronized, you can create a heartbeat table. The heartbeat table is updated or receives data every second.

Synchronize data from a Db2 for LUW database to a PolarDB for MySQL cluster

Note

By default, DTS disables foreign key constraints for the destination database during data synchronization. As a result, cascade and delete operations on the source database are not synchronized to the destination database.

Limit type

Description

Limits on the source database

  • The server that hosts the source database must have sufficient outbound bandwidth. Otherwise, the data synchronization speed decreases.

  • The tables to be synchronized must have PRIMARY KEY or UNIQUE constraints, and all fields must be unique. Otherwise, the destination database may contain duplicate data records.

  • If you select tables as the objects to be synchronized and you want to modify the tables in the destination database, such as renaming tables or columns, you can synchronize up to 5,000 tables in a single task. If you synchronize more than 5,000 tables, a request error occurs. In this case, we recommend that you split the tables across multiple tasks or synchronize the entire database.

  • The data logging feature must be enabled. Otherwise, error messages are returned during precheck, and the data synchronization task cannot be started.

    Note

    If you perform only incremental data synchronization, the data logs of the source database must be retained for more than 24 hours. If you perform both full and incremental data synchronization, the data logs must be retained for at least seven days. Otherwise, DTS may fail to obtain the data logs and the task may fail. In exceptional circumstances, data inconsistency or loss may occur. After full data synchronization is complete, you can set the retention period to more than 24 hours. Make sure that you set the retention period based on these requirements. Otherwise, the service reliability or performance stated in the SLA of DTS cannot be guaranteed.

  • Do not run DDL operations that change database or table schemas during schema synchronization or full synchronization. Otherwise, the synchronization task fails.

    Note

    During full synchronization, DTS queries the source database. This creates metadata locks that may block DDL operations on the source database.

Other limits

  • DTS synchronizes incremental data from a Db2 for LUW database to the destination database based on the CDC replication technology of Db2 for LUW. The CDC replication technology has its own limits. For more information, see General data restrictions for SQL Replication.

  • Evaluate the impact of data synchronization on the performance of the source and destination databases before you start. We recommend that you synchronize data during off-peak hours. During initial full data synchronization, DTS uses read and write resources of the source and destination databases, which may increase the load on the database servers.

  • During initial full data synchronization, concurrent INSERT operations cause fragmentation in the destination tables. After full data synchronization is complete, the used tablespace of the destination database is larger than that of the source database.

  • If your data includes four-byte characters—such as rare Chinese characters or emojis—the destination database and table must use the utf8mb4 charset.

    Note

    If you use DTS to synchronize table schemas, set the character_set_server parameter at the instance level in the destination database to utf8mb4.

  • During data synchronization, we recommend that you use only DTS to write data to the destination database to prevent data inconsistency. After data synchronization is complete, you can use DMS to execute DDL statements online. For more information, see Perform lock-free DDL operations.

  • If DDL statements fail in the destination database, the data synchronization task continues to run. You can view the failed DDL statements in the task logs. For more information, see View task logs.

  • If you write columns with names that differ only in case to the same table in the destination MySQL database, unexpected results may occur because MySQL column names are case-insensitive.

  • After data synchronization completes (the instance's Status is Completed), you should use the ANALYZE TABLE <table_name> command to confirm that all data is written to the target table. For example, after the HA failover mechanism is triggered in the target MySQL database, data might be written only to memory, which can cause data loss.

  • If a task fails, DTS support staff will attempt to restore it within eight hours. During restoration, they may restart the task or adjust its parameters.

    Note

    Only DTS task parameters are modified—not database parameters. Parameters that may be adjusted include those listed in Modify instance parameters.

Special cases

The source Db2 for LUW database is a self-managed database. When you synchronize data from the Db2 for LUW database, note the following items:

  • If you perform a primary/secondary switchover on the source database while the data synchronization task is running, the task fails.

  • DTS calculates synchronization latency based on the timestamp of the latest synchronized data record in the destination database and the current timestamp in the source database. If no DML operation is performed on the source database for a long time, the synchronization latency may be inaccurate. If the synchronization latency is too high, you can perform a DML operation on the source database to update the latency.

    Note

    If you select an entire database as the object to be synchronized, you can create a heartbeat table. The heartbeat table is updated or receives data every second.

Synchronize data from a Db2 for LUW database to an ApsaraDB RDS for MySQL instance

Note

By default, DTS disables foreign key constraints for the destination database during data synchronization. As a result, the cascade operation of the source database is not synchronized to the destination database.

Limit type

Description

Limits on the source database

  • The server that hosts the source database must have sufficient outbound bandwidth. Otherwise, the data synchronization speed decreases.

  • The tables to be synchronized must have PRIMARY KEY or UNIQUE constraints, and all fields must be unique. Otherwise, the destination database may contain duplicate data records.

  • If you select tables as the objects to be synchronized and you want to modify the tables in the destination database, such as renaming tables or columns, you can synchronize up to 5,000 tables in a single task. If you synchronize more than 5,000 tables, a request error occurs. In this case, we recommend that you split the tables across multiple tasks or synchronize the entire database.

  • The data logging feature must be enabled. Otherwise, error messages are returned during precheck, and the data synchronization task cannot be started.

    Note

    If you perform only incremental data synchronization, the data logs of the source database must be retained for more than 24 hours. If you perform both full and incremental data synchronization, the data logs must be retained for at least seven days. Otherwise, DTS may fail to obtain the data logs and the task may fail. In exceptional circumstances, data inconsistency or loss may occur. After full data synchronization is complete, you can set the retention period to more than 24 hours. Make sure that you set the retention period based on these requirements. Otherwise, the service reliability or performance stated in the SLA of DTS cannot be guaranteed.

  • Do not run DDL operations that change database or table schemas during schema synchronization or full synchronization. Otherwise, the synchronization task fails.

    Note

    During full synchronization, DTS queries the source database. This creates metadata locks that may block DDL operations on the source database.

Other limits

  • DTS synchronizes incremental data from a Db2 for LUW database to the destination database based on the CDC replication technology of Db2 for LUW. The CDC replication technology has its own limits. For more information, see General data restrictions for SQL Replication.

  • Evaluate the impact of data synchronization on the performance of the source and destination databases before you start. We recommend that you synchronize data during off-peak hours. During initial full data synchronization, DTS uses read and write resources of the source and destination databases, which may increase the load on the database servers.

  • During initial full data synchronization, concurrent INSERT operations cause fragmentation in the destination tables. After full data synchronization is complete, the used tablespace of the destination database is larger than that of the source database.

  • If your data includes four-byte characters—such as rare Chinese characters or emojis—the destination database and table must use the utf8mb4 charset.

    Note

    If you use DTS to synchronize table schemas, set the character_set_server parameter at the instance level in the destination database to utf8mb4.

  • During data synchronization, we recommend that you use only DTS to write data to the destination database to prevent data inconsistency. After data synchronization is complete, you can use DMS to execute DDL statements online. For more information, see Perform lock-free DDL operations.

  • If DDL statements fail in the destination database, the data synchronization task continues to run. You can view the failed DDL statements in the task logs. For more information, see View task logs.

  • If you write columns with names that differ only in case to the same table in the destination MySQL database, unexpected results may occur because MySQL column names are case-insensitive.

  • After data synchronization completes (the instance's Status is Completed), you should use the ANALYZE TABLE <table_name> command to confirm that all data is written to the target table. For example, after the HA failover mechanism is triggered in the target MySQL database, data might be written only to memory, which can cause data loss.

  • If a task fails, DTS support staff will attempt to restore it within eight hours. During restoration, they may restart the task or adjust its parameters.

    Note

    Only DTS task parameters are modified—not database parameters. Parameters that may be adjusted include those listed in Modify instance parameters.

Special cases

The source Db2 for LUW database is a self-managed database. When you synchronize data from the Db2 for LUW database, note the following items:

  • If you perform a primary/secondary switchover on the source database while the data synchronization task is running, the task fails.

  • DTS calculates synchronization latency based on the timestamp of the latest synchronized data record in the destination database and the current timestamp in the source database. If no DML operation is performed on the source database for a long time, the synchronization latency may be inaccurate. If the synchronization latency is too high, you can perform a DML operation on the source database to update the latency.

    Note

    If you select an entire database as the object to be synchronized, you can create a heartbeat table. The heartbeat table is updated or receives data every second.

Synchronize data from a Db2 for LUW database to an AnalyticDB for PostgreSQL instance

Note

By default, DTS disables foreign key constraints for the destination database during data synchronization. As a result, cascade and delete operations on the source database are not synchronized to the destination database.

Limit type

Description

Limits on the source database

  • The server that hosts the source database must have sufficient outbound bandwidth. Otherwise, the data synchronization speed decreases.

  • The tables to be synchronized must have PRIMARY KEY or UNIQUE constraints, and all fields must be unique. Otherwise, the destination database may contain duplicate data records.

  • If you select tables as the objects to be synchronized and you want to modify the tables in the destination database, such as renaming tables or columns, you can synchronize up to 5,000 tables in a single task. If you synchronize more than 5,000 tables, a request error occurs. In this case, we recommend that you split the tables across multiple tasks or synchronize the entire database.

  • The data logging feature must be enabled. Otherwise, error messages are returned during precheck, and the data synchronization task cannot be started.

    Note

    If you perform only incremental data synchronization, the data logs of the source database must be retained for more than 24 hours. If you perform both full and incremental data synchronization, the data logs must be retained for at least seven days. Otherwise, DTS may fail to obtain the data logs and the task may fail. In exceptional circumstances, data inconsistency or loss may occur. After full data synchronization is complete, you can set the retention period to more than 24 hours. Make sure that you set the retention period based on these requirements. Otherwise, the service reliability or performance stated in the SLA of DTS cannot be guaranteed.

  • Do not run DDL operations that change database or table schemas during schema synchronization or full synchronization. Otherwise, the synchronization task fails.

    Note

    During full synchronization, DTS queries the source database. This creates metadata locks that may block DDL operations on the source database.

Other limits

  • DTS synchronizes incremental data from a Db2 for LUW database to the destination database based on the CDC replication technology of Db2 for LUW. The CDC replication technology has its own limits. For more information, see General data restrictions for SQL Replication.

  • If the table to synchronize has a primary key, the primary key column in the destination table must match the source table. If the table to synchronize lacks a primary key, the primary key column in the destination table must match the distribution key.

  • The unique key in the destination table—including the primary key column—must include all columns in the distribution key.

  • Evaluate the impact of data synchronization on the performance of the source and destination databases before you start. We recommend that you synchronize data during off-peak hours. During initial full data synchronization, DTS uses read and write resources of the source and destination databases, which may increase the load on the database servers.

  • During initial full data synchronization, concurrent INSERT operations cause fragmentation in the destination tables. After full data synchronization is complete, the used tablespace of the destination database is larger than that of the source database.

  • During data synchronization, we recommend that you use only DTS to write data to the destination database to prevent data inconsistency. After data synchronization is complete, you can use DMS to execute DDL statements online. For more information, see Perform lock-free DDL operations.

  • During schema synchronization and incremental data synchronization, the foreign keys of the source database are not synchronized to the destination database.

  • You can select only tables as the objects to be synchronized. The tables cannot be append-optimized (AO) tables.

  • If column mapping is used for non-full table synchronization or if the source and destination table structures differ, data in columns that exist in the source but not in the destination will be lost.

  • If a task fails, DTS support staff will attempt to restore it within eight hours. During restoration, they may restart the task or adjust its parameters.

    Note

    Only DTS task parameters are modified—not database parameters. Parameters that may be adjusted include those listed in Modify instance parameters.

Special cases

The source Db2 for LUW database is a self-managed database. When you synchronize data from the Db2 for LUW database, note the following items:

  • If you perform a primary/secondary switchover on the source database while the data synchronization task is running, the task fails.

  • DTS calculates synchronization latency based on the timestamp of the latest synchronized data record in the destination database and the current timestamp in the source database. If no DML operation is performed on the source database for a long time, the synchronization latency may be inaccurate. If the synchronization latency is too high, you can perform a DML operation on the source database to update the latency.

    Note

    If you select an entire database as the object to be synchronized, you can create a heartbeat table. The heartbeat table is updated or receives data every second.

Synchronize data from a Db2 for LUW database to an ApsaraMQ for Kafka instance

Note

By default, DTS disables foreign key constraints for the destination database during data synchronization. As a result, cascade and delete operations on the source database are not synchronized to the destination database.

Limit type

Description

Limits on the source database

  • The server that hosts the source database must have sufficient outbound bandwidth. Otherwise, the data synchronization speed decreases.

  • The tables to be synchronized must have PRIMARY KEY or UNIQUE constraints, and all fields must be unique. Otherwise, the destination database may contain duplicate data records.

  • If you select tables as the objects to be synchronized and you want to modify the tables in the destination database, such as renaming tables or columns, you can synchronize up to 5,000 tables in a single task. If you synchronize more than 5,000 tables, a request error occurs. In this case, we recommend that you split the tables across multiple tasks or synchronize the entire database.

  • The data logging feature must be enabled. Otherwise, error messages are returned during precheck, and the data synchronization task cannot be started.

    Note

    If you perform only incremental data synchronization, the data logs of the source database must be retained for more than 24 hours. If you perform both full and incremental data synchronization, the data logs must be retained for at least seven days. Otherwise, DTS may fail to obtain the data logs and the task may fail. In exceptional circumstances, data inconsistency or loss may occur. After full data synchronization is complete, you can set the retention period to more than 24 hours. Make sure that you set the retention period based on these requirements. Otherwise, the service reliability or performance stated in the SLA of DTS cannot be guaranteed.

  • Do not run DDL operations that change database or table schemas during schema synchronization or full synchronization. Otherwise, the synchronization task fails.

    Note

    During full synchronization, DTS queries the source database. This creates metadata locks that may block DDL operations on the source database.

Other limits

  • The synchronization of indexes, partitions, views, stored procedures, functions, triggers, and foreign keys is not supported.

  • DTS synchronizes incremental data from a Db2 for LUW database to the destination database based on the CDC replication technology of Db2 for LUW. The CDC replication technology has its own limits. For more information, see General data restrictions for SQL Replication.

  • Evaluate the impact of data synchronization on the performance of the source and destination databases before you start. We recommend that you synchronize data during off-peak hours. During initial full data synchronization, DTS uses read and write resources of the source and destination databases, which may increase the load on the database servers.

  • During initial full data synchronization, concurrent INSERT operations cause fragmentation in the destination tables. After full data synchronization is complete, the used tablespace of the destination database is larger than that of the source database.

  • During data synchronization, we recommend that you use only DTS to write data to the destination database to prevent data inconsistency.

  • If a task fails, DTS support staff will attempt to restore it within eight hours. During restoration, they may restart the task or adjust its parameters.

    Note

    Only DTS task parameters are modified—not database parameters. Parameters that may be adjusted include those listed in Modify instance parameters.

Special cases

  • If you perform a primary/secondary switchover on the source database while the data synchronization task is running, the task fails.

  • DTS calculates synchronization latency based on the timestamp of the latest synchronized data record in the destination database and the current timestamp in the source database. If no DML operation is performed on the source database for a long time, the synchronization latency may be inaccurate. If the synchronization latency is too high, you can perform a DML operation on the source database to update the latency.

    Note

    If you select an entire database as the object to be synchronized, you can create a heartbeat table. The heartbeat table is updated or receives data every second.

  • During data synchronization, if the destination ApsaraMQ for Kafka instance is scaled, you must restart the instance.