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 Type Change Statement DML INSERT, UPDATE, DELETE DDL CREATE, ALTER, DROP, TRUNCATE Supported Data Sources: MySQL 5.6 and above, supporting self-built and cloud databases.
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
- You have already created or joined an organization, and the organization has subscribed to . Please ensure that your annual or monthly subscription is still active. For more information, please refer to Manage Organizations.
- Your current account has been switched to the target organization. For more information, please refer to Switching to an Organization.
The data source has enabled Binlog, and the Binlog-related parameters are set as follows:
binlog_format
=ROW
binlog_row_image
=FULL
tipIf 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, see 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, see Permission Application and Approval.
Operating Steps
Log in to the NineData Console.
Click > in the left navigation bar.
On the page, click the button in the upper right corner of the page.
On the page, configure according to the table below.
Parameter Description 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, see 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, see 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 72 hours. You can track data within the last month up to the current time. (Optional) Enter remarks for the current task. Click to automatically jump to the page.
In the node, wait for the task status to change to . In the node, you can also perform the following operations:
- Click the 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.
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.
After the task status changes to , you can perform the following operations before approval:
- Click the 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.
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, see Managing Organizations.
- The NineData Console is in organization mode. For how to switch from personal mode to organization mode, see Switching to Organization Mode.
- The current Track & Rollback task status is .
- You are or the for the current task.
Operating Steps
Log in to the NineData Console.
Click > in the left navigation bar.
On the page, find the target task and click the task ID or in the column on the right.
tipYou can also hover over the icon at the top of the page and click the target task on the tab.
On the page, review the approval form, and choose , , or according to the actual situation.
Operation Description 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 .
Terminate Task
If the task affects the database, it can be terminated immediately.
Prerequisites
- Have created or joined an organization. For more information, see Managing Organizations.
- The NineData Console is in organization mode. For how to switch from personal mode to organization mode, see Switching to Organization Mode.
- The current Track & Rollback task status is .
- You are either an or the creator or an of the current task.
Procedure
- Log in to the NineData Console.
- In the left navigation bar, click > .
- On the page, find the target task, and click the task ID or the in the column on the right side of the task.
- Click in the upper right corner of the page, and click in the confirmation window.
Viewing Tracking Records
Prerequisites
Organization creation or joining is completed. For more information, see Managing Organizations.
NineData Console is in organization mode. For instructions on switching from personal mode to organization mode, see Switching to Organization.
The current status of the Track & Rollback task is .
tipYou can also view parsed records when the tracking task status is .
You are either an or the creator or an of the current task .
Steps
Log in to the NineData Console.
Click on > in the left navigation bar.
On the page, locate the target task and click on the task ID or the in the column to the right of the task.
In the area, view all the changes that meet the requirements, including , , , , . Click on the button on the left of the target record to view the field details.
tipIf 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.
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 .
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.
Generate and Download Rollback SQL
When there are too many tracking records, you might need to filter out the required records through advanced search and then download them in bulk as a .sql file for easy rollback. In this scenario, you can use the feature.
Prerequisites
Organization creation or joining is completed. For more information, see Managing Organizations.
NineData Console is in organization mode. For instructions on switching from personal mode to organization mode, see Switching to Organization.
The current status of the Track & Rollback task is .
tipYou can also view parsed records when the tracking task status is .
You are either an or the creator of the current task.
Steps
Log in to the NineData Console.
In the left navigation bar, click > .
On the page, locate the target task and click the Task ID or the option in the column on the right side of the task.
On the tab, filter the tracking records as needed, then click > .
If you need to generate rollback SQL for all tracking records, you can click > .
Click the tab (located to the right of the tab), then click the option in the column next to the target record to download the rollback SQL file to your local machine.