All Products
Search
Document Center

Data Management:Data tracking

Last Updated:Aug 27, 2026

When you change data in a database using the SQL window in DMS, accidental updates, deletions, or writes can cause unexpected results. The data tracking feature in DMS lets you retrieve information about updates that occurred within a specific time period. This period is limited by the retention time of the database's binary logging (binlog). DMS can then generate a rollback script to quickly restore the data to its state before the change.

Prerequisites

  • The database is MySQL 5.6 or later.

    Note

    This includes RDS for MySQL, PolarDB for MySQL, self-managed MySQL databases on ECS instances, self-managed MySQL databases in on-premises data centers, or MySQL databases from other cloud providers that are managed in DMS Enterprise.

  • Binary logging is enabled for the database.

  • You have logged on to the target database in DMS.

    Note

    You must log on to instances in Flexible Management or Stable Change mode. You do not need to log on to instances in Security Collaboration mode.

Usage notes

  • For instances in Flexible Management mode, you can track only Data Manipulation Language (DML) operations performed within the last 30 minutes. You cannot export rollback or rebuild scripts.

  • For instances in Stable Change or Security Collaboration mode, there is no time limit. You can download rollback and rebuild scripts in batches.

  • The data that DMS can track is limited by the binlog retention period of the target database instance. If the data was changed before this retention period, DMS cannot retrieve it.

  • If binary logging is not enabled for the database or a logon error occurs, the system cannot retrieve the log files.

  • The data tracking feature supports tracking only DML data changes, not Data Definition Language (DDL) schema changes.

Procedure

  1. Log in to DMS 5.0.

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

    Note

    If you use the DMS console in simple mode, move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner of the console and choose All Features > Database Development > Data Tracking > Data Tracking Ticket.

  2. In the upper-right corner of the page, click Data Tracking.

  3. On the Data Tracking Ticket Request page, configure the following parameters:

    Parameter Name

    Description

    Task Name

    This facilitates future retrieval and provides the approver with a clear operation intent.

    Database Name

    Specify a database in the instance. You must have permissions to operate the database in DMS. After you enter a prefix of the database name, matching names appear.

    Table Name

    Search in the specified target tables. You can add multiple tables.

    Track Type

    Select one or more operation types to search for as needed.

    • Insert: The rollback statement for an insert is INSERT.

    • Update: The rollback statement for an update operation is UPDATE.

    • Delete: The corresponding rollback statement is DELETE.

    Time Range

    Select the time range to track.

    • For instances in Flexible Management mode, you can track data only within a 30-minute range.

    • For instances in Stable Change and Security Collaboration modes, there is no limit on the time range. However, a single data tracking ticket can track data for a maximum of 48 hours. If the time range exceeds 48 hours, submit multiple tickets for different time segments.

    Change Stakeholder

    Select stakeholders as needed. Users who are not ticket participants or approvers cannot view the ticket details.

  4. Click Submit. The system retrieves the log files.

    The system begins the approval process after retrieving the log file.

  5. Wait for approval.

    Note

    By default, the database administrator (DBA) is the approver for data tracking tickets. For more information about the approval rules for data tracking, see Data tracking.

  6. After the ticket is approved, the system downloads and parses the logs.

  7. After the logs are downloaded and parsed, filter the results by dimensions such as Track Type, Table Name, and Column Name to find the rollback script you need to export. Click Export Rollback Script to download the script file to your computer.

    Note
    • Click the View Details button to the right of a target record to view its details and copy the corresponding rollback statement.

    • The Track Type can be Insert, Update, or Delete.

Related operations