Get the App
SLTechnology News&Howtos  ›  Database  › 

Record an erroneous deletion of specified data from the database-& the lesson of gt; blood

Shulou Source: shulou.com Published: 2022-06-01 11:49:32 10月04日 Update

The query of select was supposed to be carried out, but the command of delete was accidentally executed, resulting in all the data of unitID=100004 being deleted.

This is awkward. This is an online database. Check the binlog log and expect it to be restored.

Fortunately, the company's database uses Aliyun's RDS database with data tracking.

Then enter the task name and the time period of the misoperation at that time. Remember: the operation must be done within 60 minutes.

When searching for logs, you can specify fields and then select to view details.

After viewing the details of all mistakenly deleted operations, the change statement in the following chart is a command executed by misoperation, and then there will be a rollback statement at the bottom. If there are multiple deleted list of details, you need to copy and paste all the rollback statements and execute the rollback statement in the database.

At this point, the data is basically restored, and then select * from xsl_user_unit_rols where unitID='100004' is executed.

Ok data has come back perfectly.

If you have learned a lesson, you will only remember it more deeply, so be sure to back up and operate carefully when you operate the database.

Https://help.aliyun.com/document_detail/63780.html, this is the link to the official document of Aliyun.

Tags: Data database statements details commands logs Ali lessons lucky embarrassed learned tasks company name chart backup multiple fields Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS NVidia Shulou Technology OPPO Reno Shulou Information