Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Data Admin Service/ User Guide/ MySQL/ Tracking and Rolling Back Data (Not Promoted)

Tracking and Rolling Back Data (Not Promoted)

Updated on 2025-01-17 GMT+08:00

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

  1. Log in to the Huawei Cloud console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner, and under Databases, click Data Admin Service.
  4. In the navigation pane on the left, choose Development Tool.

    You can also click Go to Development Tool on the overview page.

  5. Locate the DB instance that you want to log in to and click Log In in the Operation column.
  6. 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.

  7. On the displayed page, click Create Tracking Task.
  8. 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.

  9. 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.

  10. 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 logs
    NOTE:
    • 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.

  11. 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

  1. Log in to the Huawei Cloud console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner, and under Databases, click Data Admin Service.
  4. In the navigation pane on the left, choose Development Tool.

    You can also click Go to Development Tool on the overview page.

  5. Locate the DB instance that you want to log in to and click Log In in the Operation column.
  6. On the top menu bar, choose Data Scheme > Data Tracking and Rollback.
  7. Locate the task you want to view and click View Task in the Operation column.

    Figure 5 Viewing task details

  8. On the Log Search page, click Create Rollback Task. Alternatively, on the Rollback Task List page, click Create Rollback Task.
  9. 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).

  10. Click OK.
  11. 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.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback