All Products
Search
Document Center

Data Transmission Service:Configure a change tracking task by using the new DTS console

Last Updated:Oct 15, 2024

Data Transmission Service (DTS) provides an easy-to-use change tracking feature. To configure a change tracking task, you need to only perform simple operations in the new DTS console.

Usage notes

This topic provides a general procedure for configuring a change tracking task. The procedure varies based on the source and destination databases. For more information, see Overview of change tracking scenarios.

Note

This topic describes how to configure a task to track the changes of an ApsaraDB RDS for MySQL instance. The parameter configurations in this topic are for reference only. The parameters that are required when you configure a change tracking task are displayed in the DTS console.

Prerequisites

  • The source database is created and the database version is supported by DTS. For more information about the supported database types and versions, see Overview of change tracking scenarios.

  • If the source database is a self-managed database, you must prepare the environments that are required by DTS. For more information, see Preparation overview.

Procedure

  1. Go to the Change Tracking Tasks page.

    1. Log on to the Data Management (DMS) console.

    2. In the top navigation bar, click DTS.

    3. In the left-side navigation pane, choose DTS (DTS) > Change Tracking.

    Note
    • If you log on to the DMS console and click the Enter Simple Mode icon in the upper-right corner, you can move the pointer over the p483176 icon in the upper-left corner, and then choose All functions > DTS > Change Tracking. For more information, see Customize the layout and style of the DMS console.

    • You can also configure the settings by using the new DTS console.

  2. To the right of Change Tracking Tasks, select the region in which you want to create the change tracking task.

    Note

    If you use the new DTS console, you must select the region from the drop-down list to the right of Workbench on the Change Tracking Tasks page of the DTS console.

  3. Click Create Task to go to the task configuration page.

  4. Optional: In the upper-right corner of the page, click New Configuration Page.

    Note
    • Skip this step if the Back to Previous Version button is displayed in the upper-right corner of the page.

    • Some parameters may differ between the new and previous versions of the configuration page. We recommend that you use the new configuration page.

  5. Configure parameters in the Source Database and Consumer Network Type sections.

    Warning

    After you specify the source database instance, we recommend that you read the Limits that are displayed in the upper part of the page. Otherwise, the task may fail or the tracked data cannot be consumed.

    Section

    Parameter

    Description

    N/A

    Task Name

    The name of the change tracking task. DTS automatically assigns a name to the task. We recommend that you specify a descriptive name that makes it easy to identify the task. You do not need to use a unique task name.

    Source Database

    Select a DMS database instance.

    In this example, no database instance is selected. Configure the following database information.

    Database Type

    The type of the source database. Select MySQL.

    Access Method

    The access method of the source database. Select Alibaba Cloud Instance.

    Instance Region

    The region in which the source ApsaraDB RDS for MySQL instance resides.

    Replicate Data Across Alibaba Cloud Accounts

    If a database instance within the current Alibaba Cloud account is used, select No.

    RDS Instance ID

    The ID of the ApsaraDB RDS for MySQL instance.

    Database Account

    The database account of the ApsaraDB RDS for MySQL instance. The account must be a read-only account or a custom account that has the REPLICATION CLIENT, REPLICATION SLAVE, SHOW VIEW, and SELECT permissions.

    Database Password

    The password that is used to access the database instance.

    Encryption

    In this example, you can use the default setting.

    Consumer Network Type

    Network Type

    The value of the Network Type parameter is fixed to VPC. You must select a VPC and a vSwitch. For more information, see VPCs.

    Note
    • After a change tracking task is configured, you cannot change the settings in the Consumer Network Type section.

    • If your change tracking client is deployed in a VPC, we recommend that you select the same VPC and vSwitch connected to the client.

    • If you track data changes over internal networks, the network latency is minimal.

  6. In the lower part of the page, click Test Connectivity and Proceed.

    If the source database instance is an Alibaba Cloud database instance, such as an ApsaraDB RDS for MySQL or ApsaraDB for MongoDB instance, DTS automatically adds the CIDR blocks of DTS servers in the corresponding region to the whitelist of the instance. If the source database instance is a self-managed database hosted on an ECS instance, DTS automatically adds the CIDR blocks of DTS servers in the corresponding region to the security group rules of the ECS instance. To allow DTS to access the database, you must also manually add the CIDR blocks of DTS servers in the corresponding region to the security settings of the database. If the source database instance is a self-managed database that is deployed in a data center or provided by a third-party cloud service provider, you must manually add the CIDR blocks of DTS servers in the corresponding region to the security settings of the database to allow DTS to access the database. For more information, see the CIDR blocks of DTS servers section of the Add the CIDR blocks of DTS servers topic.

    Warning

    If the public CIDR blocks of DTS servers are automatically or manually added to the whitelist of a database instance or to the security group rules of an ECS instance, security risks may arise. Therefore, before you use DTS to track data changes, you must understand and acknowledge the potential risks and take preventive measures, including but not limited to the following measures: enhancing the security of your username and password, limiting the ports that are exposed, authenticating API calls, regularly checking the whitelist or security group rules and forbidding unauthorized CIDR blocks, or connecting the database instance to DTS by using Express Connect, VPN Gateway, or Smart Access Gateway.

  7. Configure the objects for change tracking.

    1. On the Select Objects page, configure the objects for change tracking.

      Parameter

      Description

      Data Change Types

      By default, the Data Change Types parameter is specified and cannot be modified.

      • Data Update

        DTS tracks data updates of the selected objects, including the INSERT, DELETE, and UPDATE operations.

      • Schema Update

        DTS tracks the create, delete, and modify operations that are performed on all object schemas of the source instance. You must use the change tracking client to filter the data to be tracked.

      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 tables or databases as the objects for change tracking.

      • If you select a database as the object, DTS tracks incremental data of all objects, including new objects in the database.

      • If you select a table as the object, DTS tracks only incremental data of this table. In this case, if you want to track data changes of another table, you must add the table to the object list. For more information, see Modify the objects for change tracking.

    2. Click Next: Advanced Settings to configure advanced settings.

      In this example, you can use the default settings or configure the parameters based on your business requirements.

      Configuration description

      Parameter

      Description

      Dedicated Cluster for Task Scheduling

      By default, DTS schedules the task to a shared cluster. You do not need to configure this parameter. You can purchase dedicated clusters of specified specifications to run DTS change tracking tasks. For more information, see What is a DTS dedicated cluster.

      Retry Time for Failed Connections

      The retry time range for failed connections. If the change tracking task fails, DTS immediately retries a connection within the time range. Valid values: 10 to 1440. Unit: minutes. Default value: 720. We recommend that you set the parameter to a value greater than 30. If DTS is reconnected to the source database instance within the specified time range, DTS resumes the change tracking task. Otherwise, the change tracking task fails.

      Note
      • If multiple change tracking tasks are configured for a database instance, the shortest retry time range takes precedence. For example, Task A and Task B are configured for the same database instance. Task A is configured with a retry time range of 30 minutes, and Task B is configured with a retry time range of 60 minutes. In this case, the retry time range of 30 minutes takes precedence.

      • When DTS retries a connection, fees are charged. We recommend that you specify the retry time range based on your business requirements, or release the DTS instance at the earliest opportunity after the source database instance is released.

      Retry Time for Other Issues

      The retry time range for other issues. For example, if DDL or DML operations fail to be performed after the change tracking task is started, DTS immediately retries the operations within the retry time range. Valid values: 1 to 1440. Unit: minutes. Default value: 10. We recommend that you set the parameter to a value greater than 10. If the failed operations are successfully performed within the specified retry time range, DTS resumes the change tracking task. Otherwise, the change tracking task fails.

      Important

      The value of the Retry Time for Other Issues parameter must be smaller than the value of the Retry Time for Failed Connections parameter.

      Environment Tag

      The environment tag that is used to identify the DTS instance. You can select an environment tag based on your business requirements.

      Whether to delete SQL operations on heartbeat tables of forward and reverse tasks

      Specifies whether to write SQL operations on heartbeat tables to the source database while the DTS instance is running. Valid values:

      • Yes: does not write SQL operations on heartbeat tables. In this case, a latency of the DTS instance may be displayed.

      • No: writes SQL operations on heartbeat tables. In this case, features such as physical backup and cloning of the source database may be affected.

      Monitoring and Alerting

      Specifies whether to enable alerting for the change tracking task. If alerting is configured and the task fails or the latency exceeds the threshold, alert notifications are sent. Valid values:

  8. In the lower part of the page, click Next: Save Task Settings and Precheck.

    • To view the parameters to be specified when you call the relevant API operation to configure the DTS task, move the pointer over Next: Save Task Settings and Precheck and click Preview OpenAPI parameters.

    • If you do not need to view or have viewed the parameters, click Next: Save Task Settings and Precheck in the lower part of the page.

    Note
    • Before you can start the change tracking task, DTS performs a precheck. You can start the change tracking task only after the task passes the precheck.

    • If the task fails to pass the precheck, click View Details next to each failed item. After you troubleshoot the issues based on the error message, you can run a precheck again.

    • If an alert is generated for an item during the precheck, perform the following operations based on the scenario:

      • If an alert item cannot be ignored, click View Details next to the failed item and troubleshoot the issues. Then, run a precheck again.

      • If the alert item can be ignored, click Confirm Alert Details. In the View Details dialog box, click Ignore. In the message that appears, click OK. Then, click Precheck Again to run a precheck again. If you ignore the alert item, data inconsistency may occur and your business may be exposed to potential risks.

  9. Wait until Success Rate becomes 100%. Then, click Next: Purchase Instance.

  10. Purchase a change tracking instance.

    1. On the Purchase page, specify the billing method of the change tracking instance. The following table describes the parameters.

      Parameter

      Description

      Billing method

      • Subscription: You pay for your subscription when you create an instance. The subscription billing method is more cost-effective than the pay-as-you-go billing method for long-term use. You are offered lower prices for longer subscription durations.

      • Pay-as-you-go: A pay-as-you-go instance is billed on an hourly basis. We recommend that you select the pay-as-you-go billing method for short-term use. If you no longer require a pay-as-you-go instance, you can release the instance to reduce costs.

      Resource Group Settings

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

      Billing Type of Change Tracking Instance

      If you select the subscription billing method, you can select only Full-price Configuration Fee (No Data Traffic Fee) for the Billing Type of Change Tracking Instance parameter.

      Subscription Duration

      If you select the subscription billing method, set the subscription duration and the number of instances that you want to create. The subscription duration can be one to nine months, one year, two years, three years, or five years.

      Note

      This parameter is available only if you select the Subscription billing method.

    2. Read and select the Data Transmission Service (Pay-as-you-go) Service Terms.

    3. Click Buy and Start to start the change tracking task. You can view the progress of the task in the task list.

What to do next

Consume tracked data