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 |