This topic describes the precautions and limits when you migrate data from a Db2 for LUW database. To ensure that your data migration task runs as expected, read the precautions and limits before you configure the task.

Migrate data from a Db2 for LUW database to a PolarDB-X instance

Category Description
Limits on the source database
  • The server to which the source database belongs must have sufficient outbound bandwidth. Otherwise, the data migration speed decreases.
  • The tables to migrate 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 objects to migrate and you need to edit tables (such as renaming tables or columns) in the destination database, up to 1,000 tables can be migrated in a single data migration task. If you run a task to migrate more than 1,000 tables, a request error occurs. In this case, we recommend that you split the tables and configure multiple tasks to migrate the tables, or configure a task to migrate the entire database.
  • If you need to migrate incremental data, you must make sure that the following requirements are met:
    • The data logging is enabled. Otherwise, error messages are returned during precheck and the data migration task cannot be started.
    • For an incremental data migration, data logs of the source database are retained for at least 24 hours. For a full data and incremental data migration, data logs of the source database are retained for at least seven days. After full data migration is complete, you can set the retention period to more than 24 hours. Otherwise, Data Transmission Service (DTS) may fail to obtain the data logs and the task may fail. In exceptional circumstances, data inconsistency or loss may occur. Make sure that you set the retention period of data logs in accordance with the preceding requirements. Otherwise, the Service Level Agreement (SLA) of DTS does not ensure service reliability and performance.

  • Limits on operations:
    • During full data migration, do not perform DDL operations to change the schemas of databases or tables. Otherwise, the data migration task fails.
    • If you perform only full data migration, do not write data to the source database during data migration. Otherwise, data inconsistency between the source and destination databases may occur. To ensure data consistency, we recommend that you select full data migration and incremental data migration.
Other limits
  • Before you configure a data migration task, you must create databases and tables in the destination instance.
  • DTS migrates incremental updates from a Db2 for LUW database to the destination database based on the Change Data Capture (CDC) replication technology of Db2 for LUW. However, the CDC replication technology has its own limits. For more information, see General data restrictions for SQL Replication.
  • Before you migrate data, evaluate the impact of data migration on the performance of the source and destination databases. We recommend that you migrate data during off-peak hours. During full data migration, DTS uses read and write resources of the source and destination databases. This may increase the loads of the database servers.
  • During full data migration, concurrent INSERT operations cause fragmentation in the tables of the destination database. After full data migration is complete, the size of the tablespace used by the destination database is larger than that of the source database.
  • You must make sure that the precision settings for columns of the FLOAT or DOUBLE data type meet your business requirements. DTS uses the ROUND(COLUMN,PRECISION) function to retrieve values from columns of the FLOAT or DOUBLE data type. If you do not specify a precision, DTS sets the precision for the FLOAT data type to 38 digits and the precision for the DOUBLE data type to 308 digits.
  • DTS attempts to resume data migration tasks that failed within the last seven days. Before you switch workloads to the destination instance, stop or release the data migration task. You can also run the revoke command to revoke the write permissions from the accounts that are used by DTS to access the destination instance. Otherwise, the data in the source database overwrites the data in the destination instance after the task is resumed.
Special cases You must take note of the following items because the Db2 for LUW source database is a self-managed database:
  • If you perform a primary/secondary switchover on the source database when the data migration task is running, the task fails.
  • DTS calculates migration latency based on the timestamp of the latest migrated data 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 migration latency may be inaccurate. If the latency of the migration task 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 migrate, you can create a heartbeat table. The heartbeat table is updated or receives data every second.