Restore a SQL Server Database to a Point in Time - SQL Server DBA Tutorial

In this video you will learn how to restore SQL Server database to Point in time using Full, Differential and T-Log backups using SQL Server management studio as well as T-SQL Script. It goes through a scenario to recover database to a specific time, step by step restoring SQL Server database to point in time.

Scripts used in video to Point in Time Restore of a SQL Server Database
USE [master] 
BACKUP LOG [SalesOrders] TO  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL12.SQLPROD\MSSQL\Backup\SalesOrders_LogBackup_2015-03-03_18-52-18.bak' WITH NOFORMAT, NOINIT,  
 NAME = N'SalesOrders_LogBackup_2015-03-03_18-52-18', 
 NOSKIP, NOREWIND, NOUNLOAD,
  
NORECOVERY ,  STATS = 5


 RESTORE DATABASE [SalesOrders] FROM  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL12.SQLPROD\MSSQL\Backup\Fullbackup603.bak'  
WITH  FILE = 1, NORECOVERY,  NOUNLOAD,  STATS = 5 

RESTORE DATABASE [SalesOrders] FROM  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL12.SQLPROD\MSSQL\Backup\Diff605.bak' 
WITH  FILE = 1,
  
NORECOVERY,  NOUNLOAD,  STATS = 5 


RESTORE LOG [SalesOrders] FROM  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL12.SQLPROD\MSSQL\Backup\Tran606.trn' 
WITH  FILE = 1,  NOUNLOAD,  STATS = 5
GO




Restore a SQL Server Database to a Point in Time - SQL Server DBA Tutorial

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.