SQL Server restores the database, the database hints are being restored in the processing method

Source: Internet
Author: User

When you restore the database, you are prompted to restore successfully, but the database in the database list appears to be being restored:

You can execute this command:

RESTORE DATABASE enterprisebuilding with RECOVERY

Understanding SQL Server script database mistakenly deleted data retrieval: http://www.cnblogs.com/Leo_wl/p/3614804.html

1. There is at least one full backup of the database before it is mistakenly deleted.

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

First, restore the required condition settings

The use of the command is to restore through the transaction log of SQL Server and a full backup of the database before it is mistakenly deleted , so in the Sqlserver2012 Maintenance Plan Wizard, to establish a full backup, differential backup, and transaction log, as follows

As well as in the database properties, option settings, set as full backup, specific as

Do a good job like the two settings, the database deleted after the deletion of data will be very easy, now say how to restore SQL Server data to the point of failure.

Second, restore command

The restoration is mainly divided into four steps:

1, after the failure, the first to execute the Backup transaction log command, where AdventureWorks as the database name. The command is as follows:

'C:\SQLServerBackups\AdventureWorks_transcationlog.bak' with    NORECOVERY;  

2. Restore data from a full backup

RESTORE  DATABASE [qasupervision] from disk='M:\Database\OA\AdventureWorks_Fullbackup_2014_03_18_ 010002_0155764.bak '      with

3. Restore data from a differential backup

RESTORE DATABASE [qasupervision] from disk='M:\Database\OA\AdventureWorks_diffbackup_2014_03_18_020002_ 0155764.bak   

4. Restore data from the transaction log before restoring to a point in time

DECLARE @dt datetime   Select @dt =dateadd (hour,-, GETDATE ())   SELECT @dtRESTORE LOG [ Qasupervision] from disk='C:\SQLServerBackups\AdventureWorks_transcationlog.bak' with [email Protected],recovery      

5. Restore the database and execute this command if the database hint is being restored.

RESTORE DATABASE AdventureWorks with RECOVERY

SQL Server restores the database, and the database prompts you for the processing in the restore

Related Article

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.