Skip to main content

Track & Rollback

The NineData Track & Rollback feature is used to analyze changes or deletions of data or object structures in the database and generate rollback statements for quick data recovery. This ensures the integrity of business data after accidental operations or data errors.

Background Information

As enterprises grow, the structure and business data of their databases gradually increase and become more complex, making data maintenance increasingly difficult. For example, a program bug may cause data errors in the business database, or after a data change operation, the values in the business database may not meet expectations. At such times, it is necessary to quickly locate the update statements that caused the failure and perform rollback operations to restore the data to its previous state.

Function Introduction

The Track & Rollback feature of NineData helps users track executed change statements in the target database and locate and rollback based on the change type and execution time range.

  • Supported Change Types:

    Change Statement TypeChange Statement
    DMLINSERT, UPDATE, DELETE
    DDLCREATE, ALTER, DROP, TRUNCATE
  • Supported Data Sources: MySQL 5.6 and above, supporting self-built and cloud databases.

Precautions

In the commercial versions (, ), please ensure that your monthly/yearly subscription is not expired, as it may result in the inability to use the Database DevOpsservice. You can quickly check the remaining quota and expiration date at the top right corner of the NineData console page.

check_quota

Usage Restrictions

  • After the Track & Rollback task is created, tracking records (Binlog parsing records) will be retained for one month, and will be cleared after one month, so please check in time.
  • If the database Binlog retains records for more than one month, the maximum traceable period is within the last month up to the current time.
  • The rollback SQL statement generation function of the Track & Rollback task currently only supports DML statements and does not support DDL statements.

Prerequisites

The data source has enabled Binlog, and the Binlog-related parameters are set as follows:

  • binlog_format=ROW
  • binlog_row_image=FULL
tip

If the data source is a standby database, to ensure complete Binlog logs are obtained, you also need to enable the log_slave_updates parameter.

Submitting Tasks

Prerequisites

  • Have permissions for the target data source's databases and tables. If not, you can apply for them first. For more information, please refer to Permission Application and Approval.
  • Have the module permission (usually granted by default). If you cannot see this entry, please contact your system administrator.
  • Have the permission . For how to apply for this permission, please refer to Permission Application and Approval.

Operating Steps

  1. Log in to the NineData Console.

  2. Click > in the left navigation bar.

  3. On the page, click the button in the upper right corner of the page.

  4. On the page, configure according to the table below.

    ParameterDescription
    Enter the name of the Track & Rollback task. For easy retrieval and management, please use a meaningful name. Up to 64 characters are supported.
    Select the data source for Track & Rollback.
    Note: If you do not have permission for this data source, please apply for it first. For more information, please refer to Permission Application and Approval.
    Select the database name for Track & Rollback.
    Note: If you do not have permission for this database, please apply for it first. For more information, please refer to Permission Application and Approval.
    Select the table name(s) for Track & Rollback, supporting multiple selections.
    (Optional)If tracking a single table, you can set a filter condition so that only results that meet this condition will be tracked.
    Select the types of changes to be tracked, multiple selections are allowed. Click to select all change types.
    Select the time zone of your region. The system will perform Track & Rollback based on the time point of the selected time zone, with the default being Beijing time zone.
    Select the time range for changes to be tracked, with a selectable period of 48 hours. You can track data within the last month up to the current time.
    (Optional)Enter remarks for the current task.
  5. Click to automatically jump to the page.

  6. In the node, wait for the task status to change to . In the node, you can also perform the following operations:

    • Click the refresh icon in the upper right corner of the page to refresh the task status.
    • Click in the upper right corner of the page to copy a new task with the same configuration.
    • Click in the upper right corner of the page to directly withdraw the task or edit and resubmit the task.
    tip
    • automatically checks the Track & Rollback task, including data source type, account permissions, Binlog configuration, Binlog file status within the specified time range, and Binlog file size. If any problems are found during the process, specific information will be provided to facilitate identification and modification.
    • If the data source is not configured with approval process, the task will automatically skip the node and proceed to the node. After parsing is completed, all changes that meet the criteria will be listed in the area of the current page, and the task will end.
  7. Click in the upper right corner of the page. In the pop-up window, select the workflow approvers and click .

    tip
    • Depending on the configuration of the approval process, different numbers of approvers need to be selected here. Please select according to the actual situation.
    • If the feature is enabled in the current approval process, this section will display . You do not need to manually specify an approver; all personnel authorized to approve the current work order will receive approval notifications and be able to approve it.

  8. After the task status changes to , you can perform the following operations before approval:

    • Click the refresh icon in the upper right corner of the page to refresh the task status.
    • Click in the upper right corner of the page to directly withdraw the task or edit and resubmit the task.
    • Click in the upper right corner of the page to change the approver of this task.
  9. After the task status changes to , the system will perform Binlog parsing. During the parsing process, all changes that meet the criteria will be listed in the area of the current page.

Approving Tasks

Prerequisites

  • Have created or joined an organization. For more information, please refer to Managing Organizations.
  • The NineData Console is in organization mode. For how to switch from personal mode to organization mode, please refer to Switching to Organization Mode.
  • The current Track & Rollback task status is .
  • You are or the for the current task.

Operating Steps

  1. Log in to the NineData Console.

  2. Click > in the left navigation bar.

  3. On the page, find the target task and click the task ID or in the column on the right.

    tip

    You can also hover over the notification icon at the top of the page and click the target task on the tab.

  4. On the page, review the approval form, and choose , , or according to the actual situation.

    OperationDescription
    Transfer the task to another user for approval.
    Approve the application. After clicking , you can enter as needed and click .
    Reject the application. After clicking , you also need to enter and click .

Viewing Tracking Records

Prerequisites

  • Organization creation or joining is completed. For more information, please refer to Managing Organizations.

  • NineData Console is in organization mode. For instructions on switching from personal mode to organization mode, please refer to Switching to Organization.

  • The current status of the Track & Rollback task is .

    :::tip You can also view parsed records when the tracking task status is . :::

Steps

  1. Log in to the NineData Console.

  2. Click on > in the left navigation bar.

  3. On the page, locate the target task and click on the task ID or the in the column to the right of the task.

  4. In the area, view all the changes that meet the requirements, including , , , , . Click on the expand button on the left of the target record to view the field details.

    tip

    If there are too many records, you can filter the required records by change time, SQL statement type, or directly search for the table name to locate the target record. Click on , select the table name, and then use to perform a more granular search on the columns in the target table.

  5. Click on on the page to download the rollback SQL of the tracking record in the form of an SQL file to your local computer, which facilitates batch data rollback. It supports two options: and .

  6. Click on the in the column to the right of the target record to view the detailed records before and after the changes corresponding to the current record. Selecting can hide columns that have not been changed. To restore to the state before the change, simply copy the SQL statement in to the database for execution.