sql2008数据库还原错误:restore headeronly 错误:3013

pltop_com 2013-04-29 03:32:39

如题所说,我在还原同样是2008备份的bak文件,提示这个错误,请大侠帮忙。原数据库无法重新备份了,服务器出了故障无法再次备份……
...全文
4557 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
最爱午夜 2015-02-11
  • 打赏
  • 举报
回复
使用脚本还原,你的这个备份文件可能需要多个备份文件一起还原。 使用窗口还原在出现多个文件时,有可能会出现媒体簇数目不对的提示。 还有,还原的时候,需要重新设置一个数据库名,给予不同的文件路径,如果是在已有的数据库上面进行还原,则有可能出现还原不了的情况。
快乐起航2020 2015-02-10
  • 打赏
  • 举报
回复
标题: Microsoft SQL Server Management Studio ------------------------------ 执行 Transact-SQL 语句或批处理时发生了异常。 (Microsoft.SqlServer.ConnectionInfo) ------------------------------ 其他信息: 设备 'E:\GongKongShop_backup_2015_02_09_130001_3894425.bak' 上的媒体簇的结构不正确。SQL Server 无法处理此媒体簇。 RESTORE HEADERONLY 正在异常终止。 (Microsoft SQL Server,错误: 3241) 有关帮助信息,请单击: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=3241&LinkId=20476 ------------------------------ 按钮: 确定 ------------------------------
jiemao178yiyi 2014-10-24
  • 打赏
  • 举报
回复
7楼正解,同样是sql2008备份出来再还原,大概是因为还原时登录的sqlserver实例(instance)是sql2005版本的。\r\n这是2008版本下的实例,\r\n这是2005版本下的实例。可以通过select @@Version来查看当下运行实例的版本,。因版本不同,所以在恢复实例的时候会提示“the media family on device *.bak is incorrectly formed”,数据库恢复失败。导致此原因的大概是本机同时安装了VS studio 2008,而VS2008会默认安装一个Sql2005版的实例。
pltop_com 2013-05-02
  • 打赏
  • 举报
回复
UPUP顶顶
pltop_com 2013-04-30
  • 打赏
  • 举报
回复
引用 12 楼 daiyueqiang 的回复:
你这个备份文件可能是多个文件,而你只拷贝了一部分呢
感谢回复 ! 在备份介质上没有发现其他文件。 我选择文件来源为以前的备份介质,也是这样的错误。
daiyueqiang2045 2013-04-30
  • 打赏
  • 举报
回复
http://translate.google.com.hk/translate?hl=zh-CN&sl=en&u=http://www.sqlservercentral.com/Forums/Topic536132-357-2.aspx&prev=/search%3Fq%3Drestore%2Bheaderonly%2B%25E9%2594%2599%25E8%25AF%25AF%25EF%25BC%259A3013%26newwindow%3D1%26safe%3Dstrict%26sa%3DG&sa=X&ei=Dxh_UfbrO8SKkgWB3YC4BA&ved=0CHsQ7gEwCQ
daiyueqiang2045 2013-04-30
  • 打赏
  • 举报
回复
你这个备份文件可能是多个文件,而你只拷贝了一部分呢
daiyueqiang2045 2013-04-30
  • 打赏
  • 举报
回复
引用 9 楼 pltop_com 的回复:
在模拟机上,将SQLSERVER2008升级到SQLSERVER 2012,操作还原,在选择备份设备界面,添加bak文件,点“内容”,依然提示错误: Microsoft.SqlServer.Smo System.Data.SqlClient.SqlError:RESTORE HEADERONLY 正在异常终止。 如果不理会上述操作,直接添加BAK文件,出现错误: 未选择要还原的备份级。 在设备内没有数据库可选择。如截图:
你的这个备份文件是不是不全呢?
pltop_com 2013-04-30
  • 打赏
  • 举报
回复
使用如下命令恢复: RESTORE DATABASE mybizdb FROM DISK='d:\1\1.bak' 出现如下信息: 消息 3203,级别 16,状态 1,第 1 行 在 "d:\1\1.bak" 上读取失败: 13(数据无效。) 消息 3013,级别 16,状态 1,第 1 行 RESTORE DATABASE 正在异常终止。 难道BAK文件损坏?
pltop_com 2013-04-30
  • 打赏
  • 举报
回复
在模拟机上,将SQLSERVER2008升级到SQLSERVER 2012,操作还原,在选择备份设备界面,添加bak文件,点“内容”,依然提示错误:
Microsoft.SqlServer.Smo
System.Data.SqlClient.SqlError:RESTORE HEADERONLY 正在异常终止。

如果不理会上述操作,直接添加BAK文件,出现错误:
未选择要还原的备份级。

在设备内没有数据库可选择。如截图:

pltop_com 2013-04-29
  • 打赏
  • 举报
回复
还是没搞定,好像不是版本问题.不知道会不会是当时备份的时候出了什么状况? 如果备份不成功,应该不会生成bak文件阿。
hyrongg 2013-04-29
  • 打赏
  • 举报
回复

Restore failed for Server - RESTORE HEADERONLY is terminating abnormally 



Recently I have upgraded my database from SQL Server 2005 Express to SQL Server 2008 Express, and I have notice on restoring database it started giving me following restore error.

Error Details

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)


------------------------------
ADDITIONAL INFORMATION:


The media family on device 'C:\NorthwindDB.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

Few things you should try before going for solution
 This error can occurs due to many reasons but you must ensure following before you start for any solution, it would save your lot of time.

1) Ensure Backup copy of Database is good.
 - Take a backup and store on machine where you tried to take backup.
 - Now create one dummy database and try to restore that database.
 - If you are able to restore that database successfully on machine backup was created, than your backup copy is good.

 You should alternately try taking backup using following command

 BACKUP DATABASE NorthwindDB
 TO DISK='C:\HostingSpaces\MyBackupCopy_NorthwindDB.bak' with FORMAT

 If you are able to take backup successfully than Backup copy is good.

2) Ensure Backup copy doesn't get corrupted during dowload.
 In my case, I have created a backup copy on Hosting Server, than stored it in .Zip Format, and than try to download it using FileZila, with default settings of filezila transfer type, i.e. Auto.

 Till this point everything was going good, but still I was not able to restore DB.

3) Important : Open SQL Query window and check version of your SQL Server.
 Run following command and see the output.

Select @@Version

 It had given me following output
Microsoft SQL Server 2005 - 9.00.4053.00 (Intel X86) May 26 2009 14:24:20 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 6.0 (Build 6002: Service Pack 2)

 After running this command i notice that even though i am using SQL Server 2008 express, it is showing that i am using SQL Server 2005

Cause of Error
 Even though I am using SQL Server 2008, but it was connected to SQL Server 2005 instance on the machine i was trying to restore.

 Remember:  Restoring Database from lower version to higher version would not give error. i.e. SQL Server 2005 to 2008 would not give error.  But restoring from higher version to lower version will always result in error.  In my case  as i was connected to SQL Server 2005 instance it results me in above error.

 You should validate that the instance is the right version by "SELECT @@version".


Solution
 You need to fix the connection so it is using the SQL 2008 instance.

 Try to run the SQL Server 2008 Express install program again, and during Name Instance configuration, specify a Name Instance with a different name.  Example: MachineName\instancename

 After installation, logged in with New Instance name created.

 Try to create database, create tables for database and try to run restore again.  It will work this time.

More about Instances
 An instance of a SQL Server database is just a named installation of SQL Server. The first one you install on any given machine typically is the default instance, which has no specific name - you just connect to it using the (local) name or the name of the server machine.

SQL Server Express typically installs as a SQLExpress instance - so the instance is called SQLExpress, and you connect to it using (local)\SQLExpress or .\SQLExpress or MyServerMachine\SQLExpress.

SQL Server instances are totally independent of one another, and you can basically install as many as you like - you just have to make sure to use unique instance names for each. But when you run the SQL Server Installation again, it will show you what instances are already installed, and prompt you for a new instance name for a new installation.

pltop_com 2013-04-29
  • 打赏
  • 举报
回复
引用 3 楼 hyrongg 的回复:
http://dotnetguts.blogspot.sg/2010/06/restore-failed-for-server-restore.html
无法访问,麻烦COPY下好么?谢谢!
引用 4 楼 Leftie 的回复:
是不是一个R2版本,一个不是
因为无法察看原机的情况,无法知道原机的sql版本,不过知道是sql 2005或sql 2008的,是不是R2就不知道了。如果是版本问题,那么我现有服务器升级到最新版本,是否就可以呢? ============= 感谢大家的热心回复,我以为今天五一放假应该很少人呢,没想到大家都在阿。
hyrongg 2013-04-29
  • 打赏
  • 举报
回复
引用 4 楼 Leftie 的回复:
是不是一个R2版本,一个不是
估计多数是高低版本的问题
饮水需思源 2013-04-29
  • 打赏
  • 举报
回复
是不是一个R2版本,一个不是
pltop_com 2013-04-29
  • 打赏
  • 举报
回复
回楼上,由于原机无法使用,无法察看是什么版本.我现在使用的是sql server 2008,也升级了ms的sp。 执行版本语句,显示: Microsoft SQL Server 2008 (SP3) - 10.0.5512.0 (X64) Aug 22 2012 19:25:47 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) 错误提示是这样的: 标题: Microsoft SQL Server Management Studio ------------------------------ 执行 Transact-SQL 语句或批处理时发生了异常。 (Microsoft.SqlServer.ConnectionInfo) ------------------------------ 其他信息: RESTORE HEADERONLY 正在异常终止。 (Microsoft SQL Server,错误: 3013) 有关帮助信息,请单击: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.5512&EvtSrc=MSSQLServer&EvtID=3013&LinkId=20476 ------------------------------ 按钮: 确定 ------------------------------
hyrongg 2013-04-29
  • 打赏
  • 举报
回复
还原机的数据库版本比备份机的要低? select @@version 看看两边的版本
模拟生产实战,对一套19.4的rac集群进行数据库迁移。迁移到另外的一套19.4的数据库集群。生产实战,带领同学一步一步操作。该方法同样适用于迁移单实例数据库到集群环境。通过该课程,同学们可以学会如下知识点。1-如何无数据丢失的进行数据迁移。2-catalog start with 如何使用3-restore database 在rman和sql命令行区别是什么4-recover database [using backup controlfile until cancel ]何时在rman使用,何时在sql命令行使用。5-进行数据恢复的时候,源库新产生的归档如何进行数据恢复。本节课会为同学们解惑一课程主题模拟生产实战,对一套19.4的rac集群进行数据库迁移。迁移到另外的一套19.4的数据库集群。 二课程特色 生产实战,带领同学一步一步操作。该方法同样适用于迁移单实例数据库到集群环境。  三课程内容 1-备份源数据库2-在目标库对备份集进行restore操作3-recover-通过rman进行recover(如何通过catalog start with 进行操作)这个时候的recover是recover哪里的归档?4-recover-通过sql命令行对源库新产生的归档进行recover5-注册数据库到集群等操作.修改remote_listener,修改密码文件,添加数据库到集群软件等操作。6-迁移验证sys用户是否可以登陆,普通用户是否可以登陆?sys用户登陆和普通用户登陆区别是什么?

22,207

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧