O'Reilly logo

SQL Server 2014 with PowerShell v5 Cookbook by Donabel Santos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

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' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required