简体   繁体   English

使用 bak 文件恢复数据库。 备份集保存现有数据库以外的数据库的备份

[英]Restore DB using a bak file. The backup set holds a backup of a database other than the existing database

I am attempting to restore a DB for example versionB using a.bak file of version A.我正在尝试使用版本 A 的 a.bak 文件来恢复例如版本 B 的数据库。

It seems like that is not the right thing to do because I am getting an error:这似乎不是正确的做法,因为我收到了一个错误:

TITLE: Microsoft SQL Server Management Studio TITLE: Microsoft SQL 服务器管理工作室

Restore of database 'B' failed.数据库“B”的还原失败。
(Microsoft.SqlServer.Management.RelationalEngineTasks) (Microsoft.SqlServer.Management.RelationalEngineTasks)

ADDITIONAL INFORMATION:附加信息:

System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'B' database. System.Data.SqlClient.SqlError:备份集包含一个数据库的备份,而不是现有的“B”数据库。 (Microsoft.SqlServer.SmoExtended) (Microsoft.SqlServer.SmoExtended)

To overwrite a database with a backup taken from a different database you must specify the WITH REPLACE option in the RESTORE command.要使用从不同数据库获取的备份覆盖数据库,您必须在 RESTORE 命令中指定WITH REPLACE选项。

REPLACE should be used rarely and only after careful consideration. REPLACE 应该很少使用,并且只有在仔细考虑之后才能使用。 Restore normally prevents accidentally overwriting a database with a different database.恢复通常可以防止意外地用不同的数据库覆盖数据库。 If the database specified in a RESTORE statement already exists on the current server and the specified database family GUID differs from the database family GUID recorded in the backup set, the database is not restored.如果 RESTORE 语句中指定的数据库已存在于当前服务器上,并且指定的数据库系列 GUID 与备份集中记录的数据库系列 GUID 不同,则不会还原数据库。 This is an important safeguard.这是一个重要的保障。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用脚本来恢复数据库,错误说备份集保存了一个非现有数据库的备份 - Using scripts to restore database, error says backup set holds a backup of a database other than existing 使用不同名称的 RESTORE 数据库失败 - “备份集包含现有数据库以外的数据库的备份” - RESTORE database with different name Fails - “The backup set holds a backup of a database other than the existing” 出现SqlServer2005错误:备份集保存除现有“ DbName”数据库以外的数据库的备份 - Getting SqlServer2005 error: backup set holds a backup of a database other than the existing 'DbName' database SQL-Server:备份集包含一个数据库的备份,而不是现有的 - SQL-Server: The backup set holds a backup of a database other than the existing 使用备份/还原在同一台机器内创建数据库的副本会引发错误:- 备份集包含数据库的备份 - Creating a Copy of a Database inside the same machine using Backup/Restore is rasing an errror :- The backup set holds a backup of a database 将数据库备份(.bak 文件)导入另一个数据库 - Import database backup (.bak file) into another database 还原备份数据库(.bak文件)-错误 - Restoring a backup database (.bak file) - Error 在mac上访问数据库备份文件? (.bak) - Access a database backup-file on mac? (.bak) 如何在wix安装程序3.9中从.bak文件(数据库备份)恢复数据库 - How to restore database from .bak file (database backup) in wix installer 3.9 将数据库的文件组备份还原到同一服务器上的另一个现有数据库上 - Restore file group backup of a database on to another existing database in same server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM