All Products
Search
Document Center

Data Management:Data tracking

Last Updated:Mar 28, 2026

When you accidentally run an INSERT, UPDATE, or DELETE statement in the DMS SQL Console, data tracking lets you parse the database binary logs to generate rollback SQL — without a full database restore.

Prerequisites

Before you begin, confirm all of the following:

  • MySQL 5.6 or later

  • Binary logging enabled on the database instance

  • The database instance connected to Data Management (DMS). Supported types:

    • ApsaraDB RDS for MySQL

    • PolarDB for MySQL

    • Self-managed MySQL on Elastic Compute Service (ECS) instances

    • Self-managed MySQL in on-premises data centers

    • MySQL databases from other cloud providers

  • Logged on to the database in DMS — except for Security Collaboration mode, which does not require a logon

Limitations

Management modeTrackable time rangeExport rollback/rebuild scripts
Flexible ManagementLast 30 minutes onlyNot supported
Stable ChangeWithin the binary log retention period, up to 48 hours per ticketSupported
Security CollaborationWithin the binary log retention period, up to 48 hours per ticketSupported

Additional constraints:

  • Only DML operations (INSERT, UPDATE, DELETE) can be tracked. DDL operations are not supported.

  • If binary logging is disabled or you have not logged on to the database, DMS cannot retrieve binary logs.

  • DMS cannot retrieve data for operations performed before the binary log retention period.

  • For time ranges exceeding 48 hours, submit multiple tickets — one per 48-hour window.

Track data changes

  1. Log on to the DMS console V5.0.

  2. In the top navigation bar, click Database Development > Data Tracking > Data Tracking Ticket.

    In simple mode, hover over the 2023-01-28_15-57-17.png icon in the upper-left corner, then choose All Features > Database Development > Data Tracking > Data Tracking Ticket.
  3. On the Data Tracking Ticket page, click Data Tracking in the upper-right corner.

  4. On the Data Tracking Tickets page, configure the following parameters, then click Submit. After you click Submit, DMS starts downloading the binary logs and the ticket moves to the Approval step.

    ParameterDescription
    Task NameEnter a name that identifies the ticket and helps approvers understand its purpose.
    Database NameSelect the database to track. You must have DMS management permissions for the database. Type a prefix to filter results.
    Table NameSelect one or more tables to track.
    Track TypeSelect the operation types to track: Insert, Update, or Delete. INSERT statements are generated to roll back INSERT operations, UPDATE statements are generated to roll back UPDATE operations, and DELETE statements are generated to roll back DELETE operations.
    Time RangeSpecify the time window. Flexible Management: last 30 minutes. Stable Change or Security Collaboration: any window within the binary log retention period, up to 48 hours per ticket.
    Change StakeholderSelect stakeholders for this ticket. Only selected stakeholders and approvers can view ticket details.
  5. Wait for the ticket to be approved.

    By default, the database administrator (DBA) of the selected database approves data tracking tickets. For approval rule details, see Data tracking.
  6. After approval, wait for DMS to download and parse the binary logs.

  7. After parsing is complete, use the Track Type, Table Name, and Column Name filters to locate the records to roll back. Select the records, then click Export Rollback Script. The rollback script downloads to your local machine.

    To inspect a single record before exporting, click View Details to review the full record and copy individual rollback statements.

What to do next

Execute the rollback script

Choose an execution method based on the number of affected rows:

Automate with the API

Use the following API operations to manage data tracking programmatically: