您的位置:首页 > 数据库

System.Data.SqlClient.SqlError: The media set has 2 media families but only 1 are provided. All memb

2013-02-05 20:47 886 查看
可能大家在使用 sql server mamagement studio 进行数据库恢复的时候会遇到这个问题:

System.Data.SqlClient.SqlError: The media set has 2 media families but only 1 are provided. All members must be provided

这段话的意思,我的个人理解是:备份的时候由两个备份文件,所以还原的时候就要不这两个备份文件都选上!!

下面我们看几个图片来了解



上图显示的是 备份的时候确认了了个 bak 文件一个是C盘 , 一个是F盘的

如果你在还原的时候,仅仅选择的是 abc.bak 的话,那么就会出现

The media set has 2 media families but only 1 are provided. All members must
be provided 这个警告了!

解决办法很简单,就是还原的时候记得把两个都选择就可以了

另外 我个人比较喜欢值选一个备份文件,在备份好之后在把这个bak文件copy到别的安全地方

最后 有个鬼佬的解释会比我的更有用,随便看看

This error message means that the original backup was done as a striped backup where the backup stream was split into two destination files.

When attempting to restore, you need to specify all of the same files which were used to take the backup.

Because this works very much like RAID1, we do not have one set of data on one file and another set of data on the other one, but rather the data is inerspersed between the two files, which is the behavior which gives optimum performace. One of the unfortunate
results of this is the fact that you cannot get any data out of a subset of the backup files used to create the backup.

The reason that you cannot do a backup adding on to one of these files is that the files themselves are initialized to understand that they are part x of a y-part backup. If you specify only 1 file, it doesn't fit.

You can always perform a backup by specifying a new backup file, and using WITH INIT.

If you don't need to stripe the backups across multiple files for performance reasons, then I'd suggest going with a single destination for management simplicity.

So, the simple version is:

If you back up to 2 files, you must specify 2 files to restore from. If you back up to 5 files, you must specify 5 files to restore from, etc.

You cannot restore any data from less than the full set of files used for the backup. This isn't like RAID 5 where we can synthesize missing data, nor is it a continuation volume, where we could restore up to the missing bit.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐