Tuesday, November 15, 2011

Transaction log backup job fails with error : The media family on device 'D:\SQL\Backups\TestDB' is incorrectly formed. SQL Server cannot process this media family.

ISSUE:

One of our maintenance job for taking transaction log backup was failing and when checked the history of Maintenance Plan it has below error:

"The backup data at the end of "D:\SQL\Backups\TestDB" is incorrectly formatted. Backup sets on the media might be damaged and unusable. To determine the backup sets on the media, use RESTORE HEADERONLY. To determine the usability of the backup sets, run RESTORE VERIFYONLY. If all of the backup sets are incomplete, reformat the media using BACKUP WITH FORMAT, which destroys all the backup sets. BACKUP LOG is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Workaround:

So verified weather file exists in location or not and yes file exists. Then ran

RESTORE VERIFYONLY FROM DISK= 'D:\SQL\Backups\TestDB';

Received below error:

Msg 3241, Level 16, State 41, Line 1
The media family on device 'D:\SQL\Backups\TestDB' is incorrectly formed. SQL Server cannot process this media family.
Msg 3013, Level 16, State 1, Line 1
VERIFY DATABASE is terminating abnormally.

Then verified the header of backup file using below command:

RESTORE HEADERONLY FROM DISK='D:\SQL\Backups\TestDB';

Output clearly shows that earlier backup is incomplete


RESOLUTION:

To resolve this issue first I have moved the existing backup file to a temp location and took fresh backup using maintenance. The job went successfully and once backup completed successfully deleted the corrupted backup file from temp location. We can delete the corrupted backup file as it is unusable anyway and need to take fresh backup.

No comments:

Post a Comment