SQLserver reduction in prompts is being restored. Solution

Today has been stuck in there when prompted to restore the database Sqlerver "Restoring ..." state, at this time can not operate the database, here I come to tell you to solve these problems methods

Solution:

DATABASE Demo the RESTORE
the FROM DISK = 'D: /demo.bak'
the WITH the MOVE 'Demo' the TO 'D: /demo.mdf',
the MOVE 'demo_log' the TO 'D: /demo.ldf',
STATS = 10, the REPLACE
the GO
if how the backup file corresponding to the logical file name, a query can be used as follows:
- returning a result set from the database, and the log file contains a list of backup sets thereof.
- Major obtain logical file name

Master the USE
RESTORE FILELISTONLY
the FROM DISK = 'D: /T/PDMTraining.bak'
Go
 Analysis:
1) management does not take the initiative to refresh, you need to manually refresh to see consideration (performance date)


Under 2) rare cases, the recovery process is suspended. This time Suppose you want to recover and return to an accessible state, to be performed:

RESTORE database   dbname with recovery

This makes the recovery process is fully completed.


3) If you want to continue to restore the log files behind, really need to put the database in "Restoring state", which is usually execute the following command:

Database dbname with the NORECOVERY RESTORE
----------------
Copyright: Original article is CSDN blogger "wjiaoling136", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/wjiaoling136/article/details/84913547

Guess you like

Origin www.cnblogs.com/ZGQ-VIP/p/11613725.html