The recovery method of SQL Server2008 database mistakenly deleting data sharing _mssql2008

Source: Internet
Author: User

Recovering data incorrectly in SQL Server is not a difficult task, and can be recovered from the transaction log. However, this recovery requires two prerequisites:

1. There is at least one complete backup of the database before the deletion of the error.

2. The recovery model for the database (Recovery mode) is full.

For these two prerequisites, there will be three different conditions:

If both prerequisites are present, the SQL statement can be recovered in three steps (reference article) without recourse to Third-party tools.

A) Back up the transaction log for the current database: BACKUP log [database name] to disk= N ' backup filename ' with NORECOVERY

b Restore a full backup before the deletion: Restore database [DB name] from DISK = N ' full backup filename ' with NORECOVERY, REPLACE

C Restore the database to the point before it was mistakenly deleted: Restore log [database] from DISK = n ' first step log backup filename ' with STOPAT = n ' mistakenly deleted before point of time ', RECOVERY

Second, if the 1th prerequisite does not exist, the 2nd prerequisite exists and requires the help of a third-party tool.

If the 2nd precondition does not exist, it cannot be recovered. Therefore, be sure to set the database recovery mode to full.

I now face the second situation, need to find third-party tools.

The log Explorer for SQL Server was started, and SQL Server 2008 is not supported.

The SQL Log Rescue was later found, and SQL Server 2008 was not supported.

The next thing to find is SysTools SQL Recovery, which supports SQL Server 2008, but needs to be purchased, and the demo version does not have data recovery capabilities.

Finally found on the officerecovery.com Recovery for SQL Server, although also commercial software, need to buy, but the demo version can restore data, as long as the database file does not exceed 24Gb. Fortunately, a friend of the database file is not large, using it to complete the recovery of mistakenly deleted data.

Share the following steps for recovering with recovery for SQL Server:

1. Run Recovery for SQL Server

2. Click File > Recover in the menu to select the data file (. mdf) of the database to be restored

3. Next > Next, enter the Recovery Configuration interface and choose Custom (choose Custom to restore the deleted data from the log).

4. Next Enter the Recovery Options window, select Search for deleted records, and select the log file path for the database to be restored.

5. Next and select the target folder (destination folders) to store the SQL statements and bat files generated during the recovery process.

6. Click Start to start the restore operation (generate the corresponding SQL file and bat file in the destination folder selected in the previous step), and then the SQL Server Database Creation Utility window appears.

7. Next, select the target database where the restored data is stored.

8. Next, select Import availiable data from both database and log files

9. Next, Next, and then complete the recovery of the data!

Next, is to celebrate the victory! The best way to celebrate victory is to write a blog!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.