Creating a backup on Mirrored Media Sets

In this recipe, we will create a full database backup on mirrored backup files.

Getting ready

We will use the AdventureWorks2014 database for this recipe. We will create a mirrored backup of the database, and both timestamped backup files will be stored in C:\Backup. Feel free to substitute this with the database you want to use with mirrored backups.


Note that mirrored backups are only supported in Developer or Enterprise editions of SQL Server. Please ensure you have either of these editions before proceeding with the recipe.

Here's the T-SQL syntax that will be generated by this PowerShell recipe:

BACKUP DATABASE [AdventureWorks2014] TO DISK = N'AdventureWorks2014.bak' MIRROR TO DISK = N'C:\Backup\AdventureWorks2014_Full_20150314092409_Copy1.bak' ...

Get SQL Server 2014 with PowerShell v5 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.