PolarDB for Oracle is a next-generation cloud-native relational database service that is developed by Alibaba Cloud. PolarDB for Oracle is highly compatible with the Oracle database engine. This topic describes how to configure one-way data synchronization between PolarDB for Oracle clusters by using Data Transmission Service (DTS).
Prerequisites
- The source PolarDB for Oracle cluster uses the latest version. For more information, see Version Management.
- The tables to be synchronized contain primary keys or UNIQUE NOT NULL indexes.
- The value of the wal_level parameter is set to logical for the source PolarDB for Oracle cluster. This setting ensures that logical decoding is supported in write-ahead logging (WAL). For more information, see Configure cluster parameters.
Precautions
- DTS uses read and write resources of the source and destination databases during initial full data synchronization. This may increase the loads of the database servers. If the database performance or specifications are unfavorable, 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 synchronize data, evaluate the impact of data synchronization on the performance of the source and destination databases. We recommend that you synchronize data during off-peak hours. For example, you can synchronize data when the CPU utilization of the source and destination databases is less than 30%.
- A single data synchronization task can synchronize data from only one database. To synchronize data from multiple databases, you must create a data synchronization task for each database.
- To ensure that the delay time of data synchronization is accurate, DTS adds a heartbeat
table named
dts_postgres_heartbeat
to the source database. The following figure shows the schema of the heartbeat table. - If you select a schema as the object to be synchronized and create a table in the
schema or run the RENAME command to rename the table, you must run the
ALTER TABLE schema.table REPLICA IDENTITY FULL;
command before you write data to the table.Note Replace theschema
andtable
in the preceding sample command with the actual schema name and table name.
SQL operations that can be synchronized
Operation type | SQL statements |
---|---|
DML | INSERT, UPDATE, and DELETE |
DDL |
Note Data definition language (DDL) statements are not synchronized in the following scenarios:
|