新的數據庫,我有一系列的手動工作:創建從備份改變MDF和LDF路徑
- 創建新的數據庫,指定替代
.mdf
和.ldf
文件位置。 - 在使用上面定義的替代路徑,並覆蓋一切
我怎樣才能做到這一點新的數據庫恢復以前的備份?我已經試過:
RESTORE DATABASE newdb
FROM DISK = 'F:\Shared\newdb.bak'
WITH MOVE 'newdb' TO 'G:\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\newdb.mdf',
MOVE 'newdb_log' TO 'G:\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\newdb_log.ldf',
replace
但我得到:
Logical file 'newdb' is not part of database 'newdb'.
Use RESTORE FILELISTONLY to list the logical file names.
RESTORE DATABASE is terminating abnormally.
如果我使用FILELISTONLY
我有另一種類型的錯誤:
Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.
恢復FILELISTONLY數據庫和恢復數據庫FILELISTONLY –
它是從磁盤恢復FILELISTONLY ......看到我的回答 –