Tous les produits
Search
Centre de documentation

Data Transmission Service:Synchroniser des données de Db2 for LUW vers PolarDB for MySQL

Dernière mise à jour :Aug 27, 2026

Accédez à la page de liste des tâches de synchronisation de la région de destination. Vous pouvez utiliser l'une des deux méthodes suivantes :

Depuis la console DTS

  1. Connectez-vous à la Data Transmission Service (DTS) console.

  2. Dans le volet de navigation de gauche, cliquez sur Data Synchronization.

  3. Dans le coin supérieur gauche de la page, sélectionnez la région où se trouve l'instance de synchronisation.

Depuis la console DMS

Remarque

Les opérations réelles peuvent varier en fonction du mode et de la disposition de la console DMS. Pour plus d'informations, consultez les rubriques Mode simple et Personnaliser la disposition et le style de l'interface DMS.

  1. Connectez-vous à Data Management (DMS).

  2. Dans la barre de menus supérieure, choisissez Data + AI > Data Transmission (DTS) > Data Synchronization.

  3. À droite de Data Synchronization Tasks, sélectionnez la région où se trouve l'instance de synchronisation.

  • Cliquez sur Create Task pour ouvrir la page de configuration de la tâche.

  • Facultatif : Dans le coin supérieur droit de la page, cliquez sur New Configuration Page.

    Remarque
    • Si le bouton dans le coin supérieur droit est Back to Previous Version, vous pouvez ignorer cette étape.

    • Les nouvelles et anciennes pages de configuration présentent des paramètres différents. Nous vous recommandons d'utiliser la nouvelle page de configuration.

  • Configurez les bases de données source et de destination.

    Section

    Parameter

    Description

    N/A

    Task Name

    DTS automatically generates a task name. We recommend that you specify a descriptive name for easy identification. The name does not have to be unique.

    Source Database

    Database Type

    Select DB2 for LUW.

    Connection Type

    Select Express Connect, VPN Gateway, or Smart Access Gateway.

    Instance Region

    Select the region where the Db2 for LUW database resides.

    Replicate Data Across Alibaba Cloud Accounts

    Select No to synchronize data within the same account.

    The VPC that has been connected to the source database

    Select the VPC ID to which the Db2 for LUW database is connected.

    IP address

    Enter the server IP address of the Db2 for LUW database.

    Port Number

    Enter the service port number of the Db2 for LUW database. Default: 50000.

    Database Name

    Enter the name of the source database that contains the objects to synchronize.

    Database Account

    Enter the database account of the Db2 for LUW instance. For required permissions, see Preparations.

    Database Password

    Enter the password that corresponds to the database account.

    Destination Database

    Database Type

    Select PolarDB for MySQL.

    Connection Type

    Select Alibaba Cloud Instance.

    Instance Region

    Select the region where the destination PolarDB for MySQL cluster resides.

    PolarDB Cluster ID

    Select the ID of the destination PolarDB for MySQL cluster.

    Database Account

    Enter the database account of the destination PolarDB for MySQL instance. For required permissions, see Preparations.

    Database Password

    Enter the password that corresponds to the database account.

    Encryption

    Select an option based on your requirements. For more information, see Configure SSL encryption.

  • Une fois la configuration terminée, cliquez sur Test Connectivity and Proceed en bas de la page. Dans la boîte de dialogue CIDR Blocks of DTS Servers, cliquez sur Test Connectivity.

    Remarque

    Assurez-vous que les blocs CIDR d'adresses IP des serveurs DTS sont ajoutés aux paramètres de sécurité des bases de données source et de destination afin d'autoriser l'accès depuis les serveurs DTS. Cette opération peut être effectuée automatiquement ou manuellement. Pour plus d'informations, consultez la rubrique Ajouter les blocs CIDR d'adresses IP des serveurs DTS à une liste d'autorisation.

  • Configurez les objets de la tâche.

    1. Sur la page Configure Objects, configurez les objets à synchroniser.

      Parameter

      Description

      Synchronization Types

      The synchronization types. 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 cluster. The historical data is the basis for subsequent incremental synchronization.

      Processing Mode for Existing Tables in Destination

      • Precheck and Report Errors: Checks whether a table with the same name exists in the destination database. If a table with the same name does not exist, the precheck passes. If a table with the same name exists, the precheck fails and the data synchronization task does not start.

        Remarque

        If you cannot delete or rename the table with the same name in the destination database, you can map it to a different table name. For more information, see Map table and column names.

      • Ignore Errors and Proceed: Skips the check for duplicate table names in the destination database.

        Avertissement

        Selecting Ignore Errors and Proceed may cause data inconsistency and put your business at risk. For example:

        • If the table schemas are the same and a record in the destination database has the same primary key or unique key value as a record in the source database:

          • During full synchronization, DTS retains the record in the destination cluster. The corresponding record from the source database is not synchronized.

          • During incremental synchronization, the record from the source database overwrites the record in the destination database.

        • If the table schemas are different, initial data synchronization may fail. This can result in only partial column data being synchronized or a complete synchronization failure. Proceed with caution.

      Case Sensitivity Policy for Destination Object Names

      You can configure the case sensitivity policy for database, table, and column object names that are synchronized to the destination instance. By default, the DTS default policy is selected. You can also choose to use the default policies of the source and destination databases. For more information, see Case sensitivity policy for destination object names.

      Source Objects

      In the Source Objects box, click an object to synchronize, and then click 向右 to move it to the Selected Objects box.

      Remarque

      You can select databases, tables, and columns as synchronization objects. If you select tables or columns, other objects such as views, triggers, and stored procedures are not synchronized to the destination database.

      Selected Objects

      • To rename a single synchronization object in the destination instance, right-click the object in the Selected Objects box. For more information about renaming objects, see Map a single database, table, or column.

      • To change the names of multiple synchronization objects in the destination instance in a batch, click Batch Edit in the upper-right corner of the Selected Objects box. For more information, see Map databases, tables, and columns in a batch.

      Remarque
      • Object name mapping may cause data inconsistency or synchronization failure for dependent objects. For example, column mapping with partial table synchronization or inconsistent table schemas may result in data loss for missing columns.

      • To filter data by using a WHERE clause, right-click the table in the Selected Objects section and set the filter conditions. For instructions, see Set filter conditions.

      • To select SQL operations for incremental synchronization at the database or table level, right-click the object in the Selected Objects section and select the SQL operations in the dialog box.

    2. Cliquez sur Next: Advanced Settings pour configurer les paramètres avancés.

      Parameter

      Description

      Dedicated Cluster for Task Scheduling

      By default, DTS schedules tasks on a shared cluster, and you do not need to select a cluster. For more stable performance, you can purchase a dedicated cluster to run DTS sync tasks. For more information, see What is a DTS dedicated cluster?.

      Select the engine type of the destination database

      Select the storage engine for the destination database.

      • InnoDB: the default storage engine.

      • X-Engine: an OLTP database storage engine.

      Retry Time for Failed Connections

      After a sync task starts, if the connection to the source or destination database fails, DTS reports an error and immediately begins to retry the connection. The default retry duration is 720 minutes. You can also specify a custom retry duration from 10 to 1 440 minutes. We recommend that you set the duration to 30 minutes or more. If DTS successfully reconnects to the database within the specified duration, the sync task automatically resumes. Otherwise, the task fails.

      Remarque
      • If you have multiple DTS instances (for example, Instance A and Instance B) that share the same source or destination, and you set the network retry time to 30 minutes for Instance A and 60 minutes for Instance B, the shorter duration of 30 minutes is used for both.

      • Because DTS charges for task runtime during the connection retry period, we recommend that you customize the retry duration based on your business needs or release the DTS instance as soon as possible after the source and destination database instances are released.

      Retry Time for Other Issues

      After the sync task starts, if other non-connectivity issues occur with the source or destination database (such as DDL or DML execution exceptions), DTS reports an error and immediately starts continuous retry operations. The default retry duration is 10 minutes. You can also customize the retry duration within the range of 1 to 1 440 minutes. We recommend that you set it to 10 minutes or more. If the relevant operations are successful within the set retry duration, the sync task automatically resumes. Otherwise, the task fails.

      Important

      The value for Retry Time for Other Issues must be less than that for Retry Time for Failed Connections.

      Enable Throttling for Full Data Synchronization

      During the full synchronization stage, DTS consumes read and write resources from the source and destination databases, which can increase the database load. To reduce the load on the source and destination databases, you can set a rate limit for the full synchronization task by configuring the Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s) parameters.

      Remarque
      • This configuration item is available only when Synchronization Types is set to Full Data Synchronization.

      • You can also adjust the full synchronization rate after the sync instance is running.

      Enable Throttling for Incremental Data Synchronization

      You can also set a rate limit for the incremental synchronization task. To relieve pressure on the destination database, set the RPS of Incremental Data Synchronization and Data synchronization speed for incremental synchronization (MB/s).

      Environment Tag

      Select an environment tag to identify the instance. Optional in this example.

      Configure ETL

      Based on your business needs, select whether to configure the ETL feature to process data.

      • Yes: Configures the ETL feature. You must also enter data processing statements in the text box.

      • No: Does not configure the ETL feature.

      Monitoring and Alerting

      Specify whether to configure alerts. If the synchronization fails or the latency exceeds the specified threshold, a notification is sent to an alert contact.

    3. Cliquez sur Next: Data Validation pour configurer une tâche de validation des données.

      Si vous souhaitez utiliser la fonctionnalité de validation des données, consultez la rubrique Configurer la validation des données pour obtenir des instructions de configuration.

  • Enregistrez la tâche et exécutez une vérification préalable.

    • Pour afficher les paramètres API permettant de configurer cette instance, placez le curseur sur le bouton Next: Save Task Settings and Precheck et cliquez sur Preview OpenAPI parameters dans l'infobulle.

    • Une fois que vous avez consulté les paramètres API, cliquez sur Next: Save Task Settings and Precheck en bas de la page.

    Remarque
    • Avant le démarrage de la tâche de synchronisation, DTS exécute une vérification préalable. La tâche ne peut démarrer qu'une fois que tous les éléments de vérification ont réussi.

    • Si la vérification préalable échoue, cliquez sur View Details pour l'élément ayant échoué. Corrigez le problème comme indiqué, puis relancez la vérification préalable.

    • Si la vérification préalable renvoie un avertissement :

      • Si un élément de vérification échoue et ne peut pas être ignoré, cliquez sur View Details à côté de l'élément. Suivez les instructions pour corriger le problème, puis relancez la vérification préalable.

      • Pour les éléments de vérification pouvant être ignorés, vous pouvez cliquer successivement sur Confirm Alert Details, View Details, OK et Ignore afin d'ignorer l'avertissement et de relancer la vérification préalable. Si vous choisissez de masquer l'élément d'avertissement, cela peut entraîner des problèmes tels que des incohérences de données et présenter des risques pour votre activité.

  • Achetez l'instance.

    1. Lorsque le Success Rate est de 100 %, cliquez sur Precheck Again.

    2. Sur la page Purchase, sélectionnez la méthode de facturation et les spécifications de lien pour l'instance de synchronisation des données. Le tableau suivant décrit ces paramètres en détail.

      Category

      Parameter

      Description

      Next: Purchase Instance

      Billing Method

      • Subscription: You pay when you create the instance. This is suitable for long-term needs and is more cost-effective than pay-as-you-go. The longer the subscription duration, the higher the discount.

      • Pay-as-you-go: You are charged on an hourly basis. This is suitable for short-term needs. You can release the instance immediately after use to save costs.

      Resource Group Configuration

      The resource group to which the instance belongs. The default is default resource group. For more information, see What is Resource Management?.

      Link Specification

      DTS provides sync specifications with different performance levels. The sync link specification affects the synchronization rate. You can choose a specification based on your business scenario. For more information, see Data synchronization link specifications.

      Subscription Duration

      In subscription mode, select the duration and quantity for the subscription instance. You can choose a monthly subscription from 1 to 9 months, or a yearly subscription of 1, 2, 3, or 5 years.

      Remarque

      This option is only available when the billing method is Subscription.

    3. Une fois la configuration terminée, lisez et acceptez les New Instance Class.

    4. Cliquez sur Buy and Start. Dans la boîte de dialogue Data Transmission Service (Pay-as-you-go) Service Terms, cliquez sur OK.

      Vous pouvez consulter la progression de la tâche sur la page Data Synchronization.

  • Data Transmission Service (DTS) vous permet de synchroniser des données d'une base de données Db2 for LUW vers un cluster PolarDB for MySQL.

    Prérequis

    • La base de données source Db2 for LUW et le cluster de destination PolarDB for MySQL sont créés. Pour connaître les versions prises en charge, consultez la rubrique Présentation de la solution de synchronisation.

    • La base de données de destination doit disposer de plus d'espace de stockage que la base de données source.

    Remarques relatives à l'utilisation

    Remarque
    • Lors de la synchronisation du schéma, DTS synchronise les clés étrangères de la base de données source vers la base de données de destination.

    • Pendant la synchronisation complète des données et la synchronisation incrémentielle des données, DTS désactive temporairement les vérifications de contraintes et les opérations en cascade de clés étrangères au niveau de la session. Des incohérences de données peuvent survenir si des opérations de mise à jour ou de suppression en cascade sont effectuées sur la base de données source pendant l'exécution de la tâche.

    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.

      Remarque

      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.

      Remarque

      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.

      Remarque

      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.

      Remarque

      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.

      Remarque

      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.

    Facturation

    Synchronization type

    Pricing

    Schema synchronization and full data synchronization

    Free of charge.

    Incremental data synchronization

    Charged. For more information, see Billing overview.

    Topologies de synchronisation prises en charge

    • Synchronisation unidirectionnelle un-à-un

    • Synchronisation unidirectionnelle un-à-plusieurs

    • Synchronisation en cascade unidirectionnelle

    • Synchronisation unidirectionnelle plusieurs-à-un

    Pour plus d'informations, consultez la rubrique Topologies de synchronisation.

    Opérations SQL prises en charge

    Operation type

    SQL operation

    DML

    INSERT, UPDATE, and DELETE

    Préparatifs