Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By : Donabel Santos
Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By: Donabel Santos

Overview of this book

Table of Contents (21 chapters)
SQL Server 2014 with PowerShell v5 Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Restoring a database to a point-in-time


In this recipe, we will use the different backup files which we have to restore to a point-in-time.

Getting ready

In this recipe, we will use the SampleDB database. The SampleDB database has a single filegroup that contains a single data file. We will restore this database to another SQL Server instance, and to a point-in-time using three different backup files from three different backup types:

  • Full backup

  • Differential backup

  • Transaction log backup

You can use the following script to create your files in B04525 - Ch05 - 10 - Restoring a Database to a Point in Time – Prep.ps1 (this is available in the code bundle available with the book), which is included in the downloadable files for this book. The prep file will perform the following tasks:

  1. Create a sample database called SampleDB.

  2. Create a table called Record inside SampleDB, which will contain a date/time column that will capture when records are inserted. This column will help verify that our point-in...