还原SQL数据库时出现问题 [英] Problem in restore SQL Database

查看:285
本文介绍了还原SQL数据库时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有.MDF和.LDF文件的SQL数据库备份.当我尝试还原时,它显示了类似
的错误

执行Transact-SQL语句或批处理时发生异常. (Microsoft.SqlServer.Express.ConnectionInfo)
------------------------------
其他信息:
设备"E:\ ElectionDB \ SAMPLE.mdf"上的媒体系列格式错误. SQL Server无法处理此媒体系列.
RESTORE HEADERONLY正在异常终止. (Microsoft SQL Server,错误:3241)



实际上,我尝试从SQL2003还原到SQL2005.
我用来还原为...

1.使用一些(SAMPLE)名称创建新数据库.(我在这里不确定我是否应该使用相同的数据库名称)

2.虽然我尝试通过右键单击->任务->恢复->数据库来恢复它.它显示了我上面提到的错误.

3.即使我只是将那些文件(.MDF和.LDF)复制并粘贴到Programfiles ---> MSSQL-> DATA-> SAMPLE.MDF& SAMPLE.LDF ....但是没有运气

请帮帮我....



I have an SQL database backup of .MDF and .LDF files. While i tried to restore, it shows error like


An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)
------------------------------
ADDITIONAL INFORMATION:
The media family on device ''E:\ElectionDB\SAMPLE.mdf'' is incorrectly formed. SQL Server cannot process this media family.
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241)



Actually i tried to restore from SQL2003 to SQL2005.
I use to restore as...

1.Create new database with some(SAMPLE) name.(I have an doubt here, whether i should have same database name)

2. While i tried to restore it by rightclick-->tasks-->restore-->database. It shows an error as i mentioned above.

3. Even i just copy and Paste those files(.MDF and .LDF) to Programfiles--->MSSQL-->DATA-->SAMPLE.MDF & SAMPLE.LDF.....but no luck

Please help me out....

推荐答案

执行以下步骤,

1)创建数据库!
2)通过rightclick-tasks-restore-database还原它.但是在此之前,请转到选项并选择覆盖现有数据库chk框.它将起作用.
do the following steps,

1) create database !
2) restore it by rightclick-tasks-restore-database.but before that go to options and select the overwrite existing database chk box. It will work.


解决方案,

我需要右键单击数据库"->附加.."->添加"

它只是创建一个数据库并在其中进行记录
解决了我的问题....
Got solution,

I need to "RightClick Databases"-->"Attach.."-->"Add"

It just create an database and made records inside
Solves my problem....


这篇关于还原SQL数据库时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆