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

Performing an online piecemeal restore

In this recipe, we will perform an online piecemeal restore.

Getting ready

We will back up a test database called StudentDB database, which has three filegroups: one primary filegroup and two custom filegroups, FG1 and FG2, in this recipe. FG1 and FG2 will have one secondary data file stored in the C:\DATA folder.

You can use the following script to create your files B04525 - Ch05 - 11 - Performing an Online PieceMeal Restore - Prep.ps1 (this is available in the code bundle available with the book), which is included in the downloadable files for this book. After the script is executed, you should see the following database:

This is how the tables will be structured:

Table

Filegroup

Data file name

Data file ...

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