This topic describes how to synchronize data from an ApsaraDB RDS for SQL Server instance to an AnalyticDB for PostgreSQL instance by using Data Transmission Service (DTS). The data synchronization feature allows you to transfer and analyze data with ease.
Prerequisites
- An ApsaraDB RDS for SQL Server instance is created. For more information, see Create an ApsaraDB RDS for SQL Server instance and Overview of data synchronization scenarios.
Notice The version of the ApsaraDB RDS for SQL Server instance can be 2012, 2016, or 2017.
- An AnalyticDB for PostgreSQL instance is created. For more information, see Create an instance.
- The source tables in the ApsaraDB RDS for SQL Server instance contain primary keys.
- The destination tables in the AnalyticDB for PostgreSQL instance contain primary keys or unique indexes.
Precautions
- DTS uses read and write resources of the source and destination databases during full data migration. This may increase the loads of the database servers. If the database performance is unfavorable, the specification is low, or the data volume is large, database services may become unavailable. For example, DTS occupies a large amount of read and write resources in the following cases: a large number of slow SQL queries are performed on the source database, the tables have no primary keys, or a deadlock occurs in the destination database. 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. For example, you can migrate data when the CPU utilization of the source and destination databases is less than 30%.
- To ensure that the delay time of data synchronization is accurate, DTS adds a heartbeat
table to the source database. The name of the heartbeat table is
dts_log_heart_beat
. - In this scenario, DTS supports schema synchronization for the following types of objects:
schema, table, view, function, and procedure.
Warning ApsaraDB RDS for SQL Server and AnalyticDB for PostgreSQL are heterogeneous databases. Their data types do not have one-to-one correspondence. We recommend that you evaluate the impact of data type conversion on your business. For more information, see Data type mappings for schema synchronization.
- DTS does not synchronize data of the following types: TIMESTAMP, CURSOR, ROWVERSION, HIERACHYID, SQL_VARIANT, SPATIAL GEOMETRY, SPATIAL GEOGRAPHY, and TABLE.
SQL operations that can be synchronized
- Data definition language (DDL) operation: ADD COLUMN
- Data manipulation language (DML) operations: INSERT, UPDATE, and DELETE
Permissions required for database accounts
Database | Required permissions | Authorization method |
---|---|---|
ApsaraDB RDS for SQL Server instance | The owner permission on the source database | Modify the permissions of a standard account on an ApsaraDB RDS for SQL Server instance |
AnalyticDB for PostgreSQL instance |
Note You can use the initial account of the AnalyticDB for PostgreSQL instance.
|
Manage users and permissions |
Procedure
FAQ
Q: How can I find the tables that are synchronized to the AnalyticDB for PostgreSQL instance?
A: During schema synchronization, DTS synchronizes tables to the destination database
based on the schema of the source database. In this example, you can find the 
customer
and Student
tables in the dbo
schema of the dtstestdata
database, as shown in the following figure. 