Quantcast
Channel: SQL Backup Archives - SQL Authority with Pinal Dave
Viewing all articles
Browse latest Browse all 110

SQL SERVER – FIX: Msg 3231 – The Media Loaded on “Backup” is Formatted to Support 1 Media Families, but 2 Media Families are Expected According to the Backup Device Specification

$
0
0

While preparing for a demo for my upcoming session, I encountered an interesting error. I thought I have written a blog about it, but I was wrong. My earlier blog was about a different error which looks very similar. Here is my earlier blog for error 3132. SQL SERVER – FIX: Msg 3132, Level 16 – The Media Set has 2 Media Families, but Only 1 is Provided. All Members Must be Provided. In this blog post, we will learn how to fix the error The Media Loaded on “Backup” is Formatted to Support 1 Media Families, but 2 Media Families are Expected According to the Backup Device Specification.

In this blog, we would learn about error 3231. Here is the complete message of the error.

Msg 3231, Level 16, State 1, Line 5
The media loaded on “C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Backup\SQLAuthority.bak” is formatted to support 1 media families, but 2 media families are expected according to the backup device specification.
Msg 3013, Level 16, State 1, Line 5
BACKUP DATABASE is terminating abnormally.

Here are the steps to reproduce the error.

CREATE DATABASE SQLAuthority
GO
BACKUP DATABASE SQLAuthority TO DISK = 'SQLAuthority.bak'
GO
BACKUP DATABASE SQLAuthority 
TO DISK = 'SQLAuthority.bak',
   DISK = 'SQLAuthority_1.bak' 
WITH DIFFERENTIAL

WORKAROUND/SOLUTION

As per error message, there is an existing backup available in SQLAuthority.bak, but in next backup, we have given two files to take split backup. One of the files is an earlier backup file which has only one media family.

The solution would be to use “FORMAT” and “INIT” to erase existing backup data in the existing backup. You might want to be careful as we are formatting existing media which has a backup. Here is the script with modification.

CREATE DATABASE SQLAuthority
GO
BACKUP DATABASE SQLAuthority TO DISK = 'SQLAuthority.bak'
GO
BACKUP DATABASE SQLAuthority 
TO DISK = 'SQLAuthority.bak',
   DISK = 'SQLAuthority_1.bak' 
WITH DIFFERENTIAL, FORMAT, INIT

If you want to use UI then below gives you the options.

SQL SERVER - FIX: Msg 3231 - The Media Loaded on "Backup" is Formatted to Support 1 Media Families, but 2 Media Families are Expected According to the Backup Device Specification backup-err-3231-01-800x587

CLEANUP SCRIPT

Here is the script to cleanup database backup history and dropping the database.

EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'SQLAuthority'
GO
USE [master]
GO
ALTER DATABASE [SQLAuthority] SET  SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
USE [master]
GO
DROP DATABASE [SQLAuthority]
GO

Have you encountered such errors while taking a backup? Please share via comments.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – FIX: Msg 3231 – The Media Loaded on “Backup” is Formatted to Support 1 Media Families, but 2 Media Families are Expected According to the Backup Device Specification


Viewing all articles
Browse latest Browse all 110

Trending Articles