- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个代码博客,但出现了问题。在这里我的备份文件是 ISBANK.bak
和数据库名称是新的数据库名称。它不包含任何东西。我要加.bak
文件的内容到一个新的数据库..
RESTORE DATABASE [DBName]
FROM DISK = 'D:\ISBANK.bak'
WITH REPLACE,
MOVE 'DBName' TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008RR2\MSSQL\DATA\DBName.mdf',
MOVE 'DBName' TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008RR2\MSSQL\DATA\DBName.ldf'
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL10.SQLSRV2008\MSSQL\DATA\OBERNET_DENEME.mdf" failed with the operating system error 3 (failed to retrieve text for this error. Reason: 15105).
Msg 3156, Level 16, State 3, Line 1
File 'OCEAN' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLSRV2008\MSSQL\DATA\OBERNET_DENEME.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL10.SQLSRV2008\MSSQL\DATA\OBERNET_DENEME.ldf" failed with the operating system error 3 (failed to retrieve text for this error. Reason: 15105).
Msg 3156, Level 16, State 3, Line 1
File 'OCEAN_log' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLSRV2008\MSSQL\DATA\OBERNET_DENEME.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
最佳答案
编辑
用替换删除
RESTORE DATABASE my_new_database FROM disk = 'E:\path_to_bak_file\database_name_634182143083281212.bak'
WITH
MOVE 'the logical name from previous operation check row 1' TO 'E:\path_to_sql2008_file_onyour_machine\my_new_database.mdf',
MOVE 'the logical name from previous operation check row 2' TO 'E:\path_to_sql2008_file_onyour_machine\my_new_database_log.ldf'
GO
关于sql - 如何在 SQL Server 2008 R2 中还原 .bak 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14040983/
我是一名优秀的程序员,十分优秀!