RESTORE 上的文档 在这里,但基本思想是 RESTORE DATABASE MyDB FROM DISK = 'F:\xxx.bak'
但是,此错误意味着文件已损坏或不完整。作为某些 FTP 或复制过程的一部分,它可能会被损坏。
一个随机的想法:SQL Server 帐户是否可以访问您的 F: 驱动器? (如果看不到该文件,我不记得错误,即使您可以在 Windows 资源管理器中看到)
You can script the task in SSMS, just before clicking the "OK"
The documentation on RESTORE is here, but the basic idea would be RESTORE DATABASE MyDB FROM DISK = 'F:\xxx.bak'
However, this error means the file is either corrupt or incomplete. It could be corrupt as part of some FTP or copy process.
One random thought: does the SQL Server account has access to your F: drive? (I don't remember the error if it can't see the file, even if you can in Windows Explorer)
正如 gbn 所说,错误消息可能意味着 SQL Server 看到的 BAK 文件已损坏。它可能被网络损坏,或者存储 BAK 文件的磁盘或磁盘控制器可能已损坏。
这是一个恢复命令示例:
restore database [DatabaseName]
from disk = N'c:\Restore\RestoreName.bak'
with file = 1,
move N'DatabaseName_Data' to N'd:\mssql\data\DatabaseName_Data.MDF',
move N'DatabaseName_Log' to N'd:\mssql\data\DatabaseName_Log.LDF',
replace
Like gbn says, the error message probably means that the BAK file SQL Server sees is corrupt. It might be corrupted by the network, or the disks or disk controller that stores the BAK file might have gone bad.
Here's an example restore command:
restore database [DatabaseName]
from disk = N'c:\Restore\RestoreName.bak'
with file = 1,
move N'DatabaseName_Data' to N'd:\mssql\data\DatabaseName_Data.MDF',
move N'DatabaseName_Log' to N'd:\mssql\data\DatabaseName_Log.LDF',
replace
Pretty sure you're backup is corrupt, but to test it, I'd suggest you use the following command:
RESTORE VERIFYONLY
FROM DISK = 'F:\xxx.bak'
That way, if there are issues with the backup file, you can catch them without possibly corrupting your database in the process. But, be warned, VERIFYONLY won't catch all issues, and if the backup was not taken with a CHECKSUM operator, it'll be a header only check of the backup file. Still, it's better than nothing.
发布评论
评论(3)
RESTORE DATABASE MyDB FROM DISK = 'F:\xxx.bak'
但是,此错误意味着文件已损坏或不完整。作为某些 FTP 或复制过程的一部分,它可能会被损坏。
一个随机的想法:SQL Server 帐户是否可以访问您的 F: 驱动器? (如果看不到该文件,我不记得错误,即使您可以在 Windows 资源管理器中看到)
RESTORE DATABASE MyDB FROM DISK = 'F:\xxx.bak'
However, this error means the file is either corrupt or incomplete. It could be corrupt as part of some FTP or copy process.
One random thought: does the SQL Server account has access to your F: drive? (I don't remember the error if it can't see the file, even if you can in Windows Explorer)
正如 gbn 所说,错误消息可能意味着 SQL Server 看到的 BAK 文件已损坏。它可能被网络损坏,或者存储 BAK 文件的磁盘或磁盘控制器可能已损坏。
这是一个恢复命令示例:
Like gbn says, the error message probably means that the BAK file SQL Server sees is corrupt. It might be corrupted by the network, or the disks or disk controller that stores the BAK file might have gone bad.
Here's an example restore command:
很确定您的备份已损坏,但为了测试它,我建议您使用以下命令:
这样,如果备份文件存在问题,您可以捕获它们,而不会在此过程中损坏数据库。但是,请注意,VERIFYONLY 不会捕获所有问题,并且如果备份不是使用 CHECKSUM 运算符进行的,则它将仅对备份文件进行标头检查。不过,有总比没有好。
Pretty sure you're backup is corrupt, but to test it, I'd suggest you use the following command:
That way, if there are issues with the backup file, you can catch them without possibly corrupting your database in the process. But, be warned, VERIFYONLY won't catch all issues, and if the backup was not taken with a CHECKSUM operator, it'll be a header only check of the backup file. Still, it's better than nothing.