Long time no blog, recently in the completion of the Rights Management module, today, when restoring the database file, encountered the "System.Data.SqlClient.SqlError: Media set has 2 media families, but only 1 are provided." Must provide all members "This error, Baidu a bit, found the cause and solution.
Cause Analysis:
1. Backup, the old path is not deleted, I added a new path, inadvertently set to two backup path, SQL will be based on two backup paths to the backup file into two.
2. When restoring, the source data must be loaded on all two backup files.
3. The new path to the restore is manually modified to the Data folder path of the actual SQL.
4. If you have a database with the same name and need to overwrite it, modify the settings.
Workaround:
1. Only one backup path is retained during backup, resulting in a backup file ~
2. If you really want to recover, you can use the following example to complete
RESTORE DATABASE db from disk= ' C:\a.bak ', disk= ' C:\b.bak '
Multiple words, use multiple disk.
You want to be able to provide solutions to other people who are experiencing this problem.
When restoring a database backup file, about the "System.Data.SqlClient.SqlError: Media set has 2 media families, but only 1 are available." All members must be provided with "how to handle