恢复数据库错误 RESTORE HEADERONLY 异常终止。
我已经在服务器上备份了SQL Server 2008 DB,并将它们下载到本地环境。
我正在尝试恢复该数据库,但它一直给我以下错误。
<小时>执行时发生异常 Transact-SQL 语句或批处理。 (Microsoft.SqlServer.ConnectionInfo)
------------------------------------------ 其他信息:
设备上的媒体系列 'C:\go4sharepoint_1384_8481.bak' 是 形成不正确。 SQL Server 不能 处理这个媒体系列。恢复 HEADERONLY 异常终止。 (Microsoft SQL Server,错误:3241)
我尝试在服务器上创建临时数据库并尝试恢复相同的备份文件并且有效。我也试过不行。很多次使用 Filezila 上的不同选项(自动、二进制)将文件从服务器下载到本地电脑,
但它不起作用。之后我尝试在服务器上执行以下命令。
BACKUP DATABASE go4sharepoint_1384_8481
TO DISK=' C:\HostingSpaces\dbname_jun14_2010_new.bak' with FORMAT
它给我以下错误:
消息 3201,级别 16,状态 1,第 1 行 无法打开备份设备 'c:\Program Files\Microsoft SQL 服务器\MSSQL10.SQLEXPRESS\MSSQL\备份\ C:\HostingSpaces\dbname_jun14_2010_new.bak'。操作系统错误 123(文件名、目录名或卷标语法为 不正确。)。消息 3013,级别 16,状态 1,第 1 行备份数据库为 异常终止。
经过研究,我发现以下两个有用的链接:
- http://support.microsoft.com/kb/290787
- http://social.msdn.microsoft.com/Forums/en -US/sqlsetupandupgrade/thread/4d5836f6-be65-47a1-ad5d-c81caaf1044f
但我仍然无法正确恢复数据库。
任何帮助将不胜感激。谢谢。
I have taken backup of SQL Server 2008 DB on server, and download them to local environment.
I am trying to restore that database and it is keep on giving me following error.
An exception occurred while executing
a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)------------------------------ ADDITIONAL INFORMATION:
The media family on device
'C:\go4sharepoint_1384_8481.bak' is
incorrectly formed. SQL Server cannot
process this media family. RESTORE
HEADERONLY is terminating abnormally.
(Microsoft SQL Server, Error: 3241)For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4053&EvtSrc=MSSQLServer&EvtID=3241&LinkId=20476
I have tried to create a temp DB on server and tried to restore the same backup file and that works. I have also tried no. of times downloading file from server to local pc using different options on Filezila (Auto, Binary)
But its not working. After that I tried to execute following command on server.
BACKUP DATABASE go4sharepoint_1384_8481
TO DISK=' C:\HostingSpaces\dbname_jun14_2010_new.bak' with FORMAT
It is giving me following error:
Msg 3201, Level 16, State 1, Line 1 Cannot open backup device
'c:\Program Files\Microsoft SQL
Server\MSSQL10.SQLEXPRESS\MSSQL\Backup\
C:\HostingSpaces\dbname_jun14_2010_new.bak'. Operating system error
123(The filename, directory name, or volume label syntax is
incorrect.). Msg 3013, Level 16, State 1, Line 1 BACKUP DATABASE is
terminating abnormally.
After researching I found the following 2 useful links:
- http://support.microsoft.com/kb/290787
- http://social.msdn.microsoft.com/Forums/en-US/sqlsetupandupgrade/thread/4d5836f6-be65-47a1-ad5d-c81caaf1044f
But I am still not able to restore Database correctly.
Any help would be much appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
您可以查看这篇博文。它解决了我的问题。
http://dotnetguts.blogspot.com/2010/06 /restore-failed-for-server-restore.html
您将需要重新安装到新的命名实例,以确保您使用的是新的 SQL Server 版本。
You can check out this blog post. It had solved my problem.
http://dotnetguts.blogspot.com/2010/06/restore-failed-for-server-restore.html
You will need to re-install to a new named instance to ensure that you are using the new SQL Server version.
当您尝试将备份数据从较高版本上传到较低版本时,就会出现此类错误。就像您有 SQL Server 2008 的备份并尝试将数据上传到 SQL Server 2005 一样,您将收到此类错误。请尝试使用更高版本上传。
This type of error will come when you try to upload backup data from a higher version to lower version. Like you have backup of SQL server 2008 and you trying to upload data into SQL server 2005 then you will get this kind of error. Please try to upload in a higher version.
我遇到了这个问题,我的问题有点复杂......
最初我试图将 SQL Server 2000 备份恢复到 SQL Server 2012。当然这不起作用,因为 SQL Server 2012 仅支持 2005 年及以上的备份。
因此,我在 SQL Server 2008 机器上恢复了数据库。完成此操作后,我将数据库复制到 SQL Server 2012 上进行恢复,但失败并出现以下错误:
设备“C:\XXXXXXXXXXX.bak”上的媒体系列格式不正确。 SQL Server 无法处理该媒体系列。 RESTORE HEADERONLY 异常终止。 (Microsoft SQL Server,错误:3241)
经过大量研究后,我发现我跳过了一步 - 我必须返回 SQL Server 2008 计算机并右键单击数据库(我想要备份)>属性>选项>确保兼容性级别设置为 SQL Server 2008。>保存
然后重新创建备份 - 此后我能够恢复到 SQL Server 2012。
I ran into this issue and my problem was a bit more involved...
Originally I was trying to restore a SQL Server 2000 backup to SQL Server 2012. Of course this didn't work cause SQL server 2012 only supports backups from 2005 and upwards .
So, I restored the database on a SQL Server 2008 machine. Once this was done - I copied the database over to restore on SQL Server 2012 - and it failed with the following error
The media family on device 'C:\XXXXXXXXXXX.bak' is incorrectly formed. SQL Server cannot process this media family. RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241)
After a lot of research I found that I had skipped a step - I had to go back to the SQL Server 2008 machine and Right Click On the database(that I wanted to backup)> Properties > Options > Make sure compatibility level is set to SQL Server 2008. > Save
And then re-create the backup - After this I was able to restore to SQL Server 2012.
此错误可能是由文件的权限引起的,您应该检查该权限,但最近我注意到,如果文件已传输并且 Windows 已将该文件标记为“加密内容以保护数据”,则会引发相同的错误。
您可以通过调出 .bak 文件属性并单击高级按钮来找到它,它显示为对话框中的最后一个复选框。
希望对某人有帮助!
This error can be caused by the permissions to the file, which you should check, however recently I noticed that the same is thrown if the file has been transferred and windows has marked the file as 'Encrypt Contents to Secure Data'.
You can find this by bringing up the .bak file properties and clicking the advanced button, it appears as the last check box on the dialog.
Hope that helps someone!
我遇到了类似的问题,但我试图从较低版本恢复到较高版本(正确)。但问题是权利不足。当我使用“Windows 身份验证”登录时,我能够恢复数据库。
I had a similar problem but I was trying to restore from lower to higher version (correct). The problem was however in insufficient rights. When I logged in with "Windows Authentication" I was able to restore the database.
我遇到了类似的错误,但我能够通过删除凭据并使用新的 SAS 令牌
DROP CREDENTIAL再次创建它来解决该问题。 (通常是为服务器 url 创建的)
CREATE CREDENTIAL; WITH IDENTITY = '<凭据名称>',
秘密='';
I had similar error but I was able to resolve it be dropping the credentials and creating it again with a new SAS token
DROP CREDENTIAL <credential_name> (generally its created for the server url)
CREATE CREDENTIAL <credential_name> WITH IDENTITY = '<credential_name>',
SECRET = '';
我的猜测是您正在尝试在较低版本中恢复,但这不起作用
My guess is that you are trying to restore in lower versions which wont work
我认为你有 2 个单独的问题,1. 恢复和 2. 创建
For 1. 你可以尝试检查文件是否已正确传输(一种简单的方法是检查服务器上文件的 md5,然后再次本地环境,看看它们是否匹配)。
I think you have 2 separate problems, 1. with restoring and 2. with creating
For 1. you could try checking to see if the file was transferred properly (one easy way would be to check the md5 of the file on the server and again on the local environment to see if they match).
这个错误是不言自明的。文件
C:\program files\...\Backup \c:\Hosting...\
格式不正确。如果您检查文件名,这一点非常明显。也许省略备份语句中的额外空间?注意
'
和C:
之间没有空格The error is quite self-explanatory. The file
C:\program files\...\Backup \c:\Hosting...\
is incorrectly formatted. This is quite obvious if you inspect the file name. Perhaps ommit the extra space in your backup statement?Note there is no space between
'
andC:
就我而言,备份文件是压缩的,但文件扩展名没有表明这一点,也没有以 .zip、.tgz 等结尾。解压备份文件后,我就可以导入它。
In my case, the backup file was compressed, but the file extension didn't indicate this, didn't end in .zip, .tgz, etc. Once I decompressed my backup file I was able to import it.
如果您尝试从 .BACPAC 文件恢复数据库,请确保在 SSMS 中选择“导入数据层应用程序”而不是恢复数据库。
If you're trying to restore a database from a .BACPAC file, make sure in SSMS you choose "Import data-tier application" and not restore database.