How Do I Specify the Start Point for DRS Incremental Synchronization?
MySQL as the Source
For a MySQL incremental synchronization task, you need to specify the start point on the Set Synchronization Task page. The source database logs of the task are obtained from the position after the start point (excluding the current start point).
If the gtid_mode parameter of the database is set to on, a start point consists of three parts: file name (File), position (Position), and executed Global Transaction Identifiers Set (Executed_Gtid_Set). You can run the show master status command to obtain these values. If the source database version is MySQL 5.5, it is not supported. When setting Executed_Gtid_Set, you need to delete the newline characters.
For example, the start point about MySQL Community Edition is as follows:
Based on the obtained information, set Executed_Gtid_Set to c8cd8ff7-da6f-11ec-a945-00d861ef1161:1-3,f4f9537f-0c8b-11ec-a284-00d861ef116a:1-10820402.
SQL Server as the Source
For a SQL Server incremental synchronization task, you need to specify the start point on the Set Synchronization Task page. The source database logs of the task are obtained from the position after the start point (excluding the current start point).
Incremental synchronization of the SQL Server database is based on the CDC capability. The start point is the LSN of the SQL Server database. You can run select sys.fn_cdc_get_max_lsn(); to query the current point of the database.
For example, query the current LSN of the database.
According to the obtained information, the start point of the task is set as follows:
DDS as the Source
For out-of-cloud synchronization from DDS to MongoDB and DDS to Kafka, you can specify a start point on the Set Synchronization Task page. The incremental logs of the source database are obtained from the start point (including the current start point). If you do not manually specify a start point, DRS automatically obtains the latest position of the source database.
The start time of incremental synchronization. The value is in the format of timestamp:incre. timestamp is the Unix timestamp (unit: second), and incre is the command execution sequence in a second. A synchronization task obtains incremental logs of the source database from the start position (including the current start position).
- For a replica set, run the db.getSiblingDB("local").oplog.rs.find({"ts":{$gte:new Timestamp(<second-level timestamp>,1)}},{"ts":1}).sort({$natural:1}).limit(1) command to query the source database oplog. The query result is in the format of { "ts" : Timestamp(<timestamp>, <inre>) }, which is converted into the format of timestamp:incre.
- A cluster cannot query the oplog from mongos. timestamp can be converted into the Unix timestamp format based on the start time. The value of incre is 1.
For example, the source database is a DDS replica set, and the expected second-level timestamp for incremental synchronization is 1721382900 (2024-07-19T17:55:00+08:00). The following figure shows the query result in the source database. According to the obtained information, the start point of the task can be set to 1721382921:554.
Oracle as the Source
For an Oracle incremental synchronization task, you need to specify the start point on the Set Synchronization Task page. The source database logs of the task are obtained from the position after the start point.
The start point of incremental synchronization is the SCN of the source database.
You can run the select current_scn from v$database; command to obtain the current SCN of a database.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot