SQL 服务器备份失败,媒体被格式化为支持 2 个媒体系列错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25086022/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 02:21:09  来源:igfitidea点击:

Backup failed for Server, The media is formatted to support 2 media families Error

sqltsqlsql-server-expressdatabase-backups

提问by CAD

Can any body tel me how to overcome this error when taking a backup in SQL Server 2008 Express?

任何人都可以告诉我如何在 SQL Server 2008 Express 中进行备份时克服这个错误?

Backup failed for Server '\SQLEXPRESS'.  (Microsoft.SqlServer.SmoExtended)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1447.4+((KJ_RTM).100213-0103+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Backup+Server&LinkId=20476

System.Data.SqlClient.SqlError: The media loaded on "D:\Project 2014\PayrollBackup" is formatted to support 2 media families, but 1 media families are expected according to the backup device specification. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1447.4+((KJ_RTM).100213-0103+)&LinkId=20476

I just want to take a single backup of my database. But always I have to give two destinations and then when restoring I cant restore the database using a single backup file? Is there anything to configure in SSMS? If any, could you please clearly explain?

我只想对我的数据库进行一次备份。但是我总是必须提供两个目的地,然后在恢复时我无法使用单个备份文件恢复数据库?在 SSMS 中有什么要配置的吗?如果有的话,能否请你清楚地解释一下?

EDIT:

编辑:

BACKUP DATABASE [Payroll] TO  DISK = N'D:\Project 2014\PayrollBackup' WITH NOFORMAT, NOINIT,  NAME = N'Payroll-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO

回答by Dave Mason

The backup statement is using the NOINITclause. This causes each successive backup to append to the existing backup file. You are attempting to backup to one media set (one file), but it appears the existing backup you are attempting to append to consisted of two media sets (two files).

备份语句正在使用NOINIT子句。这会导致每个连续的备份附加到现有的备份文件。您正在尝试备份到一个媒体集(一个文件),但您尝试附加到的现有备份似乎由两个媒体集(两个文件)组成。

For a quick turnaround, specify a new filename: BACKUP DATABASE [Payroll] TO DISK = N'D:\Project 2014\<insert new filename>' WITH ...

为了快速周转,请指定一个新文件名: BACKUP DATABASE [Payroll] TO DISK = N'D:\Project 2014\<insert new filename>' WITH ...

回答by AlexMelw

A simple solution has arisen (via SSMS), based on the answer of @DMasonand answer of @Carol Baker West.

一个简单的解决方案已经出现了(通过SSMS)的基础上,@DMason的答案解答@Carol贝克西

enter image description here

在此处输入图片说明

Just create a new media set for a single media family.

只需为单个媒体系列创建一个新媒体集。

https://i.stack.imgur.com/C6eNN.gif

https://i.stack.imgur.com/C6eNN.gif

回答by Kemono

I also received the error. In my case, I wanted to specify a different location to which the file should be backed up to. But what it was trying to do, was to now split the backup to both files in both locations - thus the part of the error:

我也收到了错误。就我而言,我想指定文件应备份到的不同位置。但是它试图做的是现在将备份拆分为两个位置的两个文件 - 因此是错误的一部分:

is formatted to support 1 media families, but 2 media families are expected according to the backup device specification. (Microsoft.SqlServer.Smo)

被格式化为支持 1 个媒体系列,但根据备份设备规范,预计有 2 个媒体系列。(Microsoft.SqlServer.Smo)

So, remove one of the destinations specified in the 'Destination' sectionof the Back Up Database wizard. It should only have one destination if it only backed up to one file previously.

因此,删除在备份数据库向导的“目标”部分指定的目标之一。如果之前只备份到一个文件,它应该只有一个目的地。

回答by Jeff Pfau

When I was attempting to restore a backup onto another server, I got the same error that you got.

当我尝试将备份恢复到另一台服务器时,我遇到了与您相同的错误。

I was able to get past this error by deleting the "Backup Device" object and recreating a new one. As you know, the Backup Device is an object that saves a path to your backup folder and to the backup file. Apparently, it also saves other information like the media family.

通过删除“备份设备”对象并重新创建一个新对象,我能够克服此错误。如您所知,备份设备是一个保存备份文件夹和备份文件路径的对象。显然,它还保存了媒体家族等其他信息。

In the SSMS interface, expand the Server Objects section, and then the Backup Devices section. Find the named backup device for the database and path that you are getting the error on. Delete that object and recreate it. That should take care of the issue.

在 SSMS 界面中,展开服务器对象部分,然后展开备份设备部分。找到数据库的命名备份设备和出现错误的路径。删除该对象并重新创建它。那应该解决这个问题。

Now, just so we are clear, I'm NOT talking about deleting the backup itself. I'm NOT talking about deleting or removing any drives. I'm NOT talking about deleting all of the backup devices listed on your server. I'm simply talking about deleting the backup device (which is an object) for one database on your server.

现在,我们很清楚,我不是在谈论删除备份本身。我不是在谈论删除或移除任何驱动器。我不是在谈论删除服务器上列出的所有备份设备。我只是在谈论删除服务器上一个数据库的备份设备(它是一个对象)。

回答by user9208516

I received this message when I was adding a database to Always On Group and log backup failed with this message:

我在将数据库添加到 Always On 组时收到此消息,并且日志备份失败并显示此消息:

'The Backup cannot be performed because the existing media set is formatted with an incompatible version'

'无法执行备份,因为现有媒体集的格式不兼容'

Problem: I was using the same backup shared folder as I was using two servers with multiple instances. Database was promoted from SQL Server 2008 R2 to SQL Server 2016. I did not delete the old 2008 R2 backups from that shared folder.

问题:我使用了相同的备份共享文件夹,因为我使用了具有多个实例的两台服务器。数据库从 SQL Server 2008 R2 升级到 SQL Server 2016。我没有从那个共享文件夹中删除旧的 2008 R2 备份。

Solution: Try and clear out the old version backups and try again. It worked for me.

解决方案:尝试清除旧版本备份,然后重试。它对我有用。

回答by vba

The issue for me was there were two sources in the Destination.

我的问题是Destination 中有两个来源。

enter image description here

在此处输入图片说明

After you backup with only one destination, removing the other. You don't get the error anymore.

仅备份一个目的地后,删除另一个目的地。你不会再收到错误了。

Let me know if this helps!

让我知道这是否有帮助!