备份集保存除现有数据库以外的数据库备份

本文翻译自:The backup set holds a backup of a database other than the existing

I am trying to restore a SQL Server backup file for my database, but it is throwing an error as follow: 我正在尝试为我的数据库还原SQL Server备份文件,但是它抛出如下错误:

The backup set holds a backup of a database other than the existing 备份集保存除现有数据库以外的数据库备份

My database in SQL Server 2008 and the backup file is in 2005. 我在SQL Server 2008中的数据库和备份文件是在2005年。

What can be the problem? 可能是什么问题?


#1楼

参考:https://stackoom.com/question/goeO/备份集保存除现有数据库以外的数据库备份


#2楼

Either: 要么:

1) Use WITH REPLACE while using the RESTORE command (if using the GUI, it is found under Options -> Overwrite the existing database ( WITH REPLACE )). 1)在使用RESTORE命令的同时使用WITH REPLACE (如果使用GUI,可以在选项->覆盖现有数据库( WITH REPLACE )下找到它)。

2) Delete the older database which is conflicting and restore again using RESTORE command. 2) Delete有冲突的旧数据库,然后使用RESTORE命令再次还原。

Check the link for more details. 检查链接以获取更多详细信息。


#3楼

Also as important is to make sure that, your database name matches the data base name in the backup you are trying to restore. 同样重要的是要确保您的数据库名称与您要还原的备份中的数据库名称匹配 If it does not match, you will get the same error. 如果不匹配,您将得到相同的错误。


#4楼

I too came across this issue. 我也遇到过这个问题。

Solution : 解决方案:

  • Don't create an empty database and restore the .bak file on to it. 不要创建一个空数据库并将.bak文件还原到该数据库上。
  • Use 'Restore Database' option accessible by right clicking the "Databases" branch of the SQL Server Management Studio and provide the database name while providing the source to restore. 右键单击SQL Server Management Studio的“数据库”分支,可以使用“还原数据库”选项,并在提供还原源的同时提供数据库名称。
  • Also change the file names at "Files" if the other database still exists. 如果另一个数据库仍然存在,也请在“文件”处更改文件名。 Otherwise you get "The file '...' cannot be overwritten. It is being used by database 'yourFirstDb'". 否则,您将收到“文件'...'无法覆盖。数据库'yourFirstDb'正在使用它”。

#5楼

I was just trying to solve this issue. 我只是想解决这个问题。

I'd tried everything from running as admin through to the suggestions found here and elsewhere; 我已经尝试了一切,从以管理员身份运行到这里和其他地方的建议; what solved it for me in the end was to check the "relocate files" option in the Files property tab. 最后为我解决的是检查“文件”属性选项卡中的“重定位文件”选项。

Hopefully this helps somebody else. 希望这可以帮助其他人。


#6楼

I had to create new db on my local for testing & i had a back up from my prod. 我必须在本地创建一个新的数据库以进行测试,而我的产品也提供了备份。 I created the db first and tried to run the BAK on top of the new db which produced this error for me. 我首先创建了数据库,然后尝试在新数据库之上运行BAK,这对我产生了此错误。 I deleted the db and restored it while sourcing the new db name in the restore screen itself. 我删除了数据库并还原了它,同时在还原屏幕本身中获取了新的数据库名称。 The db was automatically created on restore. 该数据库是在还原时自动创建的。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值