Sqlserver database restoration always displays "restoring ..." Solution

Source: Internet
Author: User

Solution:

The code is as follows: Copy code

Restore database demo
 
From disk = 'd:/demo. bak'
 
With move 'demo' TO 'D:/demo. mdf ',
 
MOVE 'Demo _ log' TO 'D:/demo. Ldf ',
 
STATS = 10, REPLACE
 
GO


If you do not know the logical file name corresponding to the backup file, you can query it as follows:

-- Returns a result set consisting of a list of databases and log files contained in the backup set.
 
-- Obtain the logical file name

The code is as follows: Copy code
 
USE master
 
RESTORE FILELISTONLY
 
<Wbr/> from disk = 'd:/T/PDMTraining. bak'
 
Go

Cause analysis

1) the manager does not actively refresh the page. You need to manually refresh the page to see the latest status (performance considerations)

2) in rare cases, the recovery process is suspended. In this case, if you want to recover and return to the accessible status, run the following command:

The code is as follows: Copy code

RESTORE database dbname with recovery

This allows the restoration process to end completely.

3) If you want to continuously restore the following log files, you do need to make the database "restoring ",

This usually refers to executing the following command:

The code is as follows: Copy code

RESTORE database dbname with norecovery

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.