All Products
Search
Document Center

ApsaraDB RDS:How do I view the incremental data of an ApsaraDB RDS for MySQL instance?

Last Updated:Dec 26, 2023

This topic describes how to view the incremental data of an ApsaraDB RDS for MySQL instance by using the SQL Explorer feature, binary logs, and Data Transmission Service (DTS).

SQL Explorer

The SQL Explorer feature records the information about all DML and DDL statements that are executed. The information is collected by the collection system from network packets. For more information, see Use the SQL Explorer feature on an ApsaraDB RDS for MySQL instance. The SQL Explorer feature does not parse actual parameter values. If a large number of SQL statements are executed, a small number of records may be lost. As a result, this method cannot precisely collect the incremental data.

Binary logs

Binary logs can accurately record all add, delete, and modify operations that are performed on a database. You can accurately restore the incremental data from binary logs. The binary logs of an RDS instance are stored in the instance, backed up and uploaded to Object Storage Service (OSS) buckets on a regular basis, and then are deleted from the RDS instance.

Procedure

  1. Log on to the ApsaraDB RDS console.

  2. In the upper-left corner of the page that appears, select the region in which your RDS instance resides.选择地域

  3. Find the RDS instance and click the instance ID.

  4. In the left-side navigation pane of the page that appears, click Backup and Restoration.

  5. On the Log Backup tab, find the binary log file that you want to download and click Download in the Actions column.

  6. Click Copy next to the public URL.

  7. Run the following command on a Linux server in which MySQL is installed to download the binary log file:

    wget -c '<Public URL of the binary log file >'
  8. Run the following command to convert the binary log file into a readable format:

    mysqlbinlog --no-defaults -v --base64-output=decode-rows <Name of the binary log file > > binlog.sql
  9. Run the more binlog.sql command to view the details of the binary log file or export the binary log file and identify problematic SQL statements.

DTS

The change tracking feature of DTS can deliver the incremental data of an RDS instance to you in real time. You can subscribe to data updates and schema updates. For more information, see Change tracking (new).