You can use Data Transmission Service (DTS) to track data changes from self-managed PosgreSQL databases and ApsaraDB RDS for PostgreSQL instances. This topic describes how to create a change tracking task to track data changes from an ApsaraDB RDS for PostgreSQL instance.
- The source ApsaraDB RDS for PostgreSQL instance is created. For more information, see Create an ApsaraDB RDS for PostgreSQL instance.
- The wal_level parameter is set to logical for the source ApsaraDB RDS for PostgreSQL instance. For more information, see Manage the parameters of an ApsaraDB RDS for PostgreSQL instance.
- The ApsaraDB RDS for PostgreSQL instance runs PostgreSQL 9.4, 10, 11, or 12.
|Limits on the source database||
|Special cases||When you track data changes from the source ApsaraDB RDS for PostgreSQL instance, do not change the endpoint or zone of the ApsaraDB RDS for PostgreSQL instance. Otherwise, the change tracking task fails.|
- Go to the Change Tracking page of the new DTS console.
- In the upper-left corner of the page, select the region where the change tracking
- Click Create Task. On the page that appears, configure the source database and the consumer network
type.Warning After you select the source instance, we recommend that you read the limits displayed at the top of the page. This helps you create and run the change tracking task.
Section Parameter Description N/A Task Name
DTS automatically generates a task name. We recommend that you specify an informative name to identify the task. You do not need to use a unique task name.
Source Database Select TemplateYou can choose whether to use a database connection template.
- If you use a connection template, DTS automatically applies the parameter settings
of the source database.
- You can modify the parameter settings of a connection template.
- To edit the template name, you can click Edit Template Name at the bottom of the Source Database section.
- The modified connection template will take effect the next time you select the connection template. The database instance that you have configured by using the template is not affected.
- If you do not use a connection template, you must set parameters for the source database.
Database Type Select PostgreSQL. Access Method Select Alibaba Cloud Instance. Instance Region Select the region in which the ApsaraDB RDS for PostgreSQL instance resides. Instance ID Select the ID of the ApsaraDB RDS for PostgreSQL instance. Database Name Enter the name of the source database. Database Account Enter the privileged account of the ApsaraDB RDS for PostgreSQL instance. The account must be the owner of the database. For more information about how to create an account on an ApsaraDB RDS for PostgreSQL instance and grant permissions to this account, see Create an account on an ApsaraDB RDS for PostgreSQL instance and Create a database on an ApsaraDB RDS for PostgreSQL instance. Database Password
Enter the password of the database account.
Save as Template Consumer Network Type
Select the network type of the change tracking instance.Note
- If your change tracking client is deployed on a local server, you can select Classic or VPC.
- If your change tracking client is deployed on an ECS instance, we recommend that you select the network of the ECS instance. For example, if the ECS instance is deployed in a VPC, select VPC as the network type and specify the VPC and vSwitch parameters.
- If you track data changes over internal networks, the network latency is minimal.
Notice After a change tracking task is configured, you cannot change the network type. Data changes are tracked and consumed over the specified type of network.
If you select Classic, no other configurations are required. For more information, see Classic network.
If you select VPC, you must specify the VPC and vSwitch parameters. For more information, see VPCs.
- If you use a connection template, DTS automatically applies the parameter settings of the source database.
- In the lower part of the page, click Test Connectivity and Proceed.
- Select objects for the task and configure advanced settings.
- Basic Settings
Parameter Description Data Change Types
You can select only Data Update. DTS tracks data updates of the objects that you select. Data updates include the INSERT, DELETE, and UPDATE operations.
Source ObjectsSelect one or more objects from the Source Objects section and click the icon to move 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 data changes of all objects, including new objects in the database.
- If you select a table as the object, DTS tracks only data changes of this table. In this case, if you want to track data changes of another table, you must add the table to the selected objects. For more information, see Modify the objects for change tracking.
- Advanced Settings
Parameter Description Set AlertsSpecify whether to set alerts for the change tracking task. If the task fails or the latency exceeds the threshold, the alert contacts will receive notifications.
- Select No if you do not want to set alerts.
- Select Yes to set alerts. In this case, you must also set the alert threshold and alert contacts.
Retry Time for Failed ConnectionsSpecify the retry time for failed connections. Valid values: 10 to 1440. Unit: minutes. Default value: 120. We recommend that you set the retry time to more than 30 minutes. If DTS reconnects to the source and destination databases within the specified time, DTS resumes the change tracking task. Otherwise, the change tracking task fails.Note
- If multiple DTS instances have the same source or destination database, the lowest value takes effect. For example, the retry time is set to 30 minutes for Instance A and 60 minutes for Instance B, DTS retries failed connections at an interval of 30 minutes.
- When DTS retries a connection, you are charged for the DTS instance. We recommend that you specify the retry time based on your business needs. You can also release the DTS instance at your earliest opportunity after the source and destination instances are released.
- Basic Settings
- 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, you can click the icon next to each failed item to view details.
- You can troubleshoot the issues based on the causes and run a precheck again.
- If you do not need to troubleshoot the issues, you can ignore failed items and run a precheck again.
- Wait until the Success Rate becomes 100%. Then, click Next: Purchase Instance.
- On the Purchase Instance page, specify the billing method of the change tracking instance. The following table
describes the parameters.
Parameter Description Billing Method
- Subscription: You can pay for your subscription when you create an instance. We recommend that you select the subscription billing method for long-term use because it is more cost-effective than the pay-as-you-go billing method. You can save more costs with longer subscription periods.
- 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 your pay-as-you-go instance, you can release it to reduce costs.
Billing Type of Change Tracking Instance
If you select the subscription billing method, you can select only USD 120 per month for configuration fee (no data traffic fee) as the billing type of the change tracking instance.
Subscription LengthIf you select the subscription billing method, set the subscription length and the number of instances that you want to create. The subscription length can be one to nine months or one to three years.Note This parameter is available only if you select the subscription billing method.Note When a client accesses the change tracking instance over the Internet, DTS charges Internet traffic fee.
- Read and select Data Transmission Service (Pay-as-you-go) Service Terms.
- Click Buy and Start to start the change tracking task. You can view the progress of the task in the task list.