SQL-Server:备份集保存了一个数据库的备份,而不是现有的

问题描述:

我正在尝试为我的数据库恢复 SQL Server 备份文件,但它抛出如下错误:

I am trying to restore a SQL Server backup file for my database, but it is throwing an error as follow:

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

The backup set holds a backup of a database other than the existing

我的数据库是 SQL Server 2008,备份文件是 2005.

My database in SQL Server 2008 and the backup file is in 2005.

可能是什么问题?

我也遇到了这个问题.

解决方案:

  • 不要创建一个空的数据库并将 .bak 文件恢复到它上面.
  • 使用恢复数据库"选项,可通过右键单击 SQL Server Management Studio 的数据库"分支访问并提供数据库名称,同时提供要恢复的源.
  • 如果另一个数据库仍然存在,还要更改文件"中的文件名.否则你会得到文件'...'不能被覆盖.它正在被数据库'yourFirstDb'使用".
  • Don't create an empty database and restore the .bak file on to it.
  • 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.
  • 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'".