Binlog
Binlogs record database table changes, including data insertion, update, and deletion, and DDL statements. If a database is faulty or a DML statement is incorrectly executed, DAS can parse the binlogs to restore data.
Prerequisites
- You have created an RDS for MySQL instance.
- You have enabled binlogs.
Procedure
- 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, choose Intelligent O&M > Instance List.
Alternatively, on the Overview page, click Go to Intelligent O&M.
- In the upper right corner of the Instance List page, search for instances by engine type, instance name, or instance IP.
- Locate the target instance and click Details.
- On the displayed page, click the Binlog tab.
Figure 1 BinlogYou can perform the following operations:
- Archived Logs
- On the Archived Logs tab, you can view non-fragmented backup log files, which record database changes in the instance.
Figure 2 Archived Logs
- You can specify Start and End Time to search for log files within a specified period.
- Click Parse Log to parse the binlog. Wait until the parsing is complete.
- After the status changes to Parsed, click View Details. Historical SQL operations are displayed. You can filter change records by start and end time, database name, table name, and operation type.
Figure 3 Viewing log details
- Click View Data to view data change details of each record.
Figure 4 Viewing data
- Click Delete Parsing Results to clear the log records.
- Click Export and select an OBS bucket to export a log file.
Figure 5 Exporting log files
- Click View Export List to view the exported log file.
Figure 6 View Export List
- On the View Export List page, click Download to download the log file to the local PC.
- On the View Export List page, click Delete to delete the log file.
- Open the downloaded log file and view event details, including the original SQL statement and rollback statement. Run the rollback statement in the development tool or other database connection tools to roll back the database changes and restore data. You need to roll back each operation from the latest event.
Figure 7 Events
- On the Archived Logs tab, you can view non-fragmented backup log files, which record database changes in the instance.
- Latest Logs
- On the Latest Logs tab, you can view all binlog files of the instance.
Figure 8 Latest Logs
- Click View Overview to view the type, server ID, location, and details of all events in a log file.
Figure 9 Viewing the overview
- For details about other operations, see Archived Logs.
- On the Latest Logs tab, you can view all binlog files of the instance.
- Archived Logs
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