Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to recover the deleted data of sql database

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to restore the deleted data of sql database. I hope you will gain a lot after reading this article. Let's discuss it together.

The recovery of mistakenly deleted data in SQL Server is not difficult, but it can be recovered from the transaction log. However, there are two prerequisites for this recovery:

The method of sql database data recovery:

1. At least one full backup of the database before it was mistakenly deleted.

two。 The recovery model (Recovery mode) of the database is "Full".

In view of these two prerequisites, there will be three situations:

Case 1. If both prerequisites exist, it can be restored in only three steps through the SQL statement (without the help of third-party tools.

A) backup the transaction log of the current database: BACKUP LOG [database name] TO disk= N' backup file name 'WITH NORECOVERY

B) restore a full backup before erroneous deletion: RESTORE DATABASE [database name] FROM DISK = N' full backup file name 'WITH NORECOVERY, REPLACE

C) restore the database to the point in time before erroneous deletion: RESTORE LOG [database] FROM DISK = N' first step log backup file name 'WITH STOPAT = N' point in time before erroneous deletion, RECOVERY

Case 2, if the first prerequisite does not exist, the second prerequisite exists, with the help of third-party tools.

Third, if the second prerequisite does not exist, it cannot be restored. Therefore, be sure to set the database recovery model to Full.

In the second case, you need to find third-party tools.

Recommendation: eventually find Recovery for SQL Server on officerecovery.com, although it is also commercial software that needs to be purchased, but the Demo version can recover data as long as the database file does not exceed 24Gb. Fortunately, my friend's database file is not large, so I use it to complete the recovery of mistakenly deleted data.

After reading this article, I believe you have a certain understanding of how to recover deleted data from sql database. If you want to know more about it, welcome to follow the industry information channel. Thank you for your reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report