All Products
Search
Document Center

Data Transmission Service:Specify the policy for migrating data to Kafka partitions

Last Updated:Jun 16, 2026

You can specify a Kafka partition policy for data migration tasks to improve performance. For example, you can distribute data across partitions based on hash values.

Hash algorithm

Data Transmission Service (DTS) uses the hashCode() method in Java to calculate hash values.

Configuration method

Specify the Kafka partition policy in the Configure Migration Types and Objects step of the task creation wizard. For more information, see Migrate self-managed Oracle to Message Queue for Apache Kafka and Migration scenarios.

Warning After a data migration task is started, do not change the number of partitions in the destination topic. Otherwise, data migration fails.

Policies

Policy Description Advantage and disadvantage
Ship All Data to Partition 0 Migrates all data and DDL statements to Partition 0 of the destination topic.
  • Advantage: The creation and change order of all objects is preserved as in the source database.
  • Disadvantage: Migration performance is limited.
Ship Data to Separate Partitions Based on Hash Values of Database and Table Names Uses the database and table names as the partition key to calculate the hash value, then migrates the data and DDL statements of each table to the corresponding partition of the destination topic.
Note
  • The data and DDL statements of the same table are migrated to the same partition.
  • If a DDL statement is irrelevant to a table, for example, CREATE DATABASE, the statement is migrated to Partition 0.
  • Advantage: The creation and change order of each destination table matches the source table, with good migration performance.
  • Disadvantage: Data changes across different tables may be out of order after migration.
Ship Data to Separate Partitions Based on Hash Values of Primary Keys Uses a table column as the partition key to calculate the hash value. By default, the primary key is used. If a table does not have a primary key, the unique key is used instead. Each row is migrated to the corresponding partition of the destination topic. You can also specify one or more columns as partition keys.
Note
  • If you use this policy, DDL statements are migrated to Partition 0 of the destination topic by default.
  • If a table does not have a primary key or unique key, DTS migrates the data and DDL statements of the table to Partition 0 of the destination topic.
  • Advantage: This policy provides the best migration performance.
  • Disadvantage: The change order of each data record is preserved, but changes across different tables or tables without a primary key may be out of order.