- What's New
- Function Overview
- Service Overview
- Billing
- Getting Started
-
User Guide
- Permissions Management
- Logging in to a DB Instance
-
MySQL
- Account Management
- Database Management
- SQL Operations
- Table Management
- View Management
- Stored Procedure Management
- Event Management
- Trigger Management
- Function Management
- Data Import and Export
- Data Generator (Not Promoted)
- Tracking and Rolling Back Data (Not Promoted)
- Task Management
- Table Structure Comparison and Synchronization (Not Promoted)
- Intelligent O&M (New Version)
- Intelligent O&M (Old Version)
- RDS for SQL Server
- PostgreSQL
-
RDS for MariaDB
- Account Management
- Database Management
- SQL Operations
- Table Management
- View Management
- Stored Procedure Management
- Event Management
- Trigger Management
- Function Management
- Data Import and Export
- Data Generator (Not Promoted)
- Task Management
- Table Structure Comparison and Synchronization (Not Promoted)
- Intelligent O&M
- GaussDB
-
TaurusDB
- Account Management
- Database Management
- SQL Operations
- Table Management
- View Management
- Event Management
- Stored Procedure Management
- Function Management
- Trigger Management
- Data Import and Export
- Data Generator (Not Promoted)
- Task Management
- Table Structure Comparison and Synchronization (Not Promoted)
- Intelligent O&M
- GeminiDB Cassandra
- GaussDB(DWS) (Unavailable Soon)
- DDS
- DDM
- Audit
- Event Monitoring
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
APIs (in OBT)
- API Version Queries
-
Cloud DBA
- Registering a Database User
- Modifying a Database User
- Deleting a Database User
- Querying Intelligent O&M Quotas
- Querying Database User Information
- Querying Database Users
- Killing Sessions
- Querying the SQL Execution Plan (GET Request)
- Querying the SQL Execution Plan (POST Request)
- Querying Metadata Locks
- Querying Instance Sessions
- Querying InnoDB Lock Waits
- Enabling or Disabling SQL Explorer and Slow Query Log
- Querying Whether SQL Explorer and Slow Query Log Are Enabled
- Exporting Slow Query Logs
- Exporting SQL Explorer Data
- Querying Whether SQL Statement Concurrency Control Is Enabled
- Enabling or Disabling SQL Statement Concurrency Control
- Querying Concurrency Control Rules of SQL Statements
- Generate Keywords of a Concurrency Control Rule from the Original SQL Statement
- Creating a Concurrency Control Rule for SQL Statements
- Deleting a Concurrency Control Rule of SQL Statements
- Querying SQL Statement Concurrency Control Tasks
- Exporting the Top SQL Template List
- Exporting SQL Execution Time Distribution
- Exporting the Slow SQL Template List
- Viewing the Instance List on the Intelligent O&M Page
- Setting a Shared Link
- Deleting a Shared Link
- Executing a SQL Diagnosis
- Obtaining Diagnosis Results
- Creating an Instance Diagnosis Task
- Querying Instance Diagnosis Reports
- Obtaining an Instance Diagnosis Report
- Synchronizing the Instance List
- Deprecated APIs
- Permissions Policies and Supported Actions
- Appendixes
-
FAQs
-
Product Consulting
- How Is DAS Billed?
- Which Data Sources Does DAS Support?
- Does DAS Support Multi-Region Access?
- Where Is SQL Execution Records Saved If I Enable This Function?
- What Should I Enter in the Database Column to Log In to a PostgreSQL DB Instance on the DAS Console?
- Will I Be Changed If I Enable Collect Metadata Periodically and Show Executed SQL Statements on the Add Login Page?
-
Managing connections
- What Should I Do If I Can't Connect to My DB Instance Due to Insufficient Permissions?
- What Should I Do If I Can't Connect to My RDS for MySQL Instance?
- What Should I Do If I Can't Connect to My ECS (MySQL) Instance?
- What Should I Do If I Can't Connect to My RDS for SQL Server Instance?
- What Should I Do If I Can't Connect to My ECS (Microsoft SQL Server) Instance?
- What Should I Do If I Can't Connect to My RDS for PostgreSQL Instance?
- What Should I Do If I Can't Connect to My ECS (PostgreSQL) Instance?
- What Should I Do If I Can't Connect to My DDS Instance?
- What Should I Do If I Can't Connect to My GaussDB(for MySQL) Instance?
- What Should I Do If I Can't Connect to My GaussDB Instance?
- What Should I Do If I Can't Connect to My DDM Instance?
- How Do I View and Modify ECS Security Group Rules?
- How Do I View and Modify Firewall Rules?
- What Should I Do If My Connection Fails?
-
Usage
- What Can I Do If Garbled Characters Are Displayed in the Exported Database Result Set?
- What Are the Precautions for Connecting DAS to a Third-Party Client?
- What Are the Username and Password for DAS?
- What Should I Do If Table Obtaining Times Out?
- How Do I Modify the Collation?
- When a user creates a data tracking task, an error message indicating that the current user does not have the OBS operator permissions is displayed.
- Resource Freezing, Release, Deletion, and Unsubscription
-
Product Consulting
- Glossary
- Videos
-
More Documents
-
User Guide (ME-Abu Dhabi Region)
- Service Overview
- Getting Started
-
User Guide
- Permissions Management
- Logging In to the DAS Console
- Adding Login Information
- Modifying Login Information
- Deleting Login Information
- Logging In to Databases Shared by Others
- MySQL DB Instance Management (Development Tool)
- Microsoft SQL Server DB Instance Management (Development Tool)
- PostgreSQL DB Instance Management (Development Tool)
- DDS DB Instance Management (Development Tool)
- Enterprise Change Approval
- Intelligent O&M
- FAQs
- Change History
-
User Guide (Kuala Lumpur Region)
- Service Overview
- Getting Started
-
User Guide
- Permissions Management
- Logging in to a DB Instance
-
MySQL
- Account Management
- Database Management
- SQL Operations
- Table Management
- View Management
- Stored Procedure Management
- Event Management
- Trigger Management
- Function Management
- Data Import and Export
- Data Generator (Not Promoted)
- Tracking and Rolling Back Data (Not Promoted)
- Task Management
- Table Structure Comparison and Synchronization (Not Promoted)
- Intelligent O&M (New Version)
- Intelligent O&M
- RDS for SQL Server
- PostgreSQL
- DDS
- DDM
- Audit
-
FAQs
-
Managing connections
- What Should I Do If I Can't Connect to My RDS for MySQL Instance?
- What Should I Do If I Can't Connect to My ECS (MySQL) Instance?
- What Should I Do If I Can't Connect to My RDS for PostgreSQL Instance?
- What Should I Do If I Can't Connect to My ECS (PostgreSQL) Instance?
- What Should I Do If I Can't Connect to My DDS Instance?
- What Can I Do If a GaussDB(for MySQL) Instance Fails to Be Connected?
- What Should I Do If I Can't Connect to My GaussDB Instance?
- What Should I Do If I Can't Connect to My DDM Instance?
- How Do I View and Modify ECS Security Group Rules?
- How Do I View and Modify Firewall Rules?
- What Should I Do If My Connection Fails?
- Usage
-
Managing connections
- Change History
-
User Guide (ME-Abu Dhabi Region)
- General Reference
Copied.
Tracking and Rolling Back Data (Not Promoted)
The data tracking and rollback function helps you track and roll back data changes. This section describes how to track and roll back data changes.
This function can be used to:
- Audit core data changes, collect change statistics, and view sensitive information. For example, you can use this function to query bank statements, statistics on new orders, and key change history of a configuration table.
- Roll back data misoperations, recover the data deleted by mistake, and restore changed data to the original status. For example, the WHERE condition is not added when DBAs update data, configuration data is deleted by mistake, a large amount of dirty data and impacts are generated due to bugs.
Prerequisites
- You have enabled the data tracing and rollback function.
- The binlog function has been enabled for the destination database.
Data Tracking
- Log in to the Huawei Cloud console.
- Click
in the upper left corner and select a region and project.
- Click
in the upper left corner, and under Databases, click Data Admin Service.
- In the navigation pane on the left, choose Development Tool.
You can also click Go to Development Tool on the overview page.
- Locate the DB instance that you want to log in to and click Log In in the Operation column.
- On the top menu bar, choose Data Scheme > Data Tracking and Rollback.
Figure 1 Viewing task details
- Search for a task by time range or database name.
- In the task list, locate the task and click its ID to view details.
- In the task list, click View Task in the Operation column. Then, you can view task information, search logs, and rollback tasks.
- If a task is not required any longer, you can select it and click delete in the upper lefter corner. Change history of the task will be deleted from the DAS storage.
NOTE:
The default validity period of a data tracking task is 15 days. Once a task expires, the system automatically retrieves and deletes the changes in DAS.
- On the displayed page, click Create Tracking Task.
- In the displayed dialog box, configure required parameters.
Figure 2 Creating a tracking task
Table 1 Parameters of a tracking task Parameter
Description
Task Name
Task name, which is user-defined.
Time Range
Time range for data tracking. You are advised to select a time span less than 3 hours.
Database Name
Database whose data is to be tracked.
Table Name
Select a table to be searched. Multiple tables can be added.
Data Tracking Type
You can select multiple tracking operations.
The following four options are supported:
- Update
- Insert
- Delete
- DDL
NOTE:
Users who create a tracking task for the first time need to view and agree to the data security agreement.
- Click Precheck to search for binlog files based on the selected time range.
- RDS instances with the backup function enabled periodically back up binlog files and store them to your OBS bucket. The backup delay is no more than five minutes.
- When you create a tracking task, there may be no changes in the latest five minutes. In this case, you can create a task again later.
- After the precheck is successful, click Read Logs to obtain log details.
When reading logs, the system initiates binlog parsing and stores log changes for filtering and displaying data.
Figure 3 Reading logsNOTE:
- You can search for logs only after all logs are successfully read.
- If a new task is started before the last tracking task is completely read, it is normal that the log start time is later than the end time.
- After the logs are read, click Log Search to obtain details about change events.
- On the Log Search page, you can view information about the change events, such as event IDs, change time, change types, table names, impacted rows, and descriptions.
- You can also view data or rollback statements in the Operation column.
Figure 4 Searching for logs
Rolling Back Data
- Log in to the Huawei Cloud console.
- Click
in the upper left corner and select a region and project.
- Click
in the upper left corner, and under Databases, click Data Admin Service.
- In the navigation pane on the left, choose Development Tool.
You can also click Go to Development Tool on the overview page.
- Locate the DB instance that you want to log in to and click Log In in the Operation column.
- On the top menu bar, choose Data Scheme > Data Tracking and Rollback.
- Locate the task you want to view and click View Task in the Operation column.
Figure 5 Viewing task details
- On the Log Search page, click Create Rollback Task. Alternatively, on the Rollback Task List page, click Create Rollback Task.
- In the displayed dialog box, configure required parameters.
Figure 6 Creating a rollback task
Table 2 Parameters for creating a rollback task Parameter
Description
Start Event ID
The start event ID is the one in the task list and must be entered in ascending order. You can view the event ID by referring to 11.
End Event ID
The end event ID is the one in the task list and must be entered in ascending order. You can view the event ID by referring to 11.
Rollback Statement Storage
Enter an OBS bucket.
To keep your data secure, DAS stores rollback statements in the OBS bucket you provide. In this way, DAS automatically connects to your OBS bucket for in-memory reading. Your data will never be flushed to any storage media of DAS.
Creating OBS buckets is free of charge, but saving files will incur certain costs.
Charset
Specify a character set.
Statement Type
- Generate event rollback SQL statements: generates SQL statements for rolling back reverse changes based on the images before and after data change.
- Obtain the original data before changes: generates rollback tables and insert statements by mirroring before data change.
Advanced Settings
You can also set Data Tracking Type, Table Name, Field, and Field Content under Advanced Settings as required.
NOTE:
Changing a record (primary key) three consecutive times (for example, 1->2->3->4) equals the change of 1 to 4 (1->4).
- Click OK.
- In the rollback task list, view the created rollback task.
Figure 7 Viewing the created rollback task
- Locate the rollback task you created and click View Detail in the Operation column.
- Click Download in the Operation column to download the original data before data change and event-based rollback SQL statements to your local PC.
- Enter a task ID in the search box in the upper right corner of the task list to search for the required task.
- In the Operation column, sort out tasks by task ID, start event ID, end event ID, file size, and status.
NOTE:
Changes (such as insert->delete, delete->insert, update->update) on the same record will be combined or canceled. So, the generated file may have no rollback SQL statements or original data.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot