<

Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

How to Restore a Database from a Backup (SQL Server)

Posted on
11,812 Points
1,112 Views
17 Endorsements
Last Modified:
Experience Level: Beginner
5:17
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
17
Comment
Author:Steve Wales
2 Comments
 

Expert Comment

by:enrique_aeo
Backup schedule
Full database backups Saturday 10PM
Differential backups Monday, Tuesday, Thursday, Friday at 10PM
Log backups every hour (on the hour) from 9AM to 6PM
Failure Occurred at  Thursday at 10:30AM
What restore process should be followed?

Question: If a failure occurs at Thursday at 10:30AM, what is the restore process that should be undertaken?
0
 
LVL 23

Author Comment

by:Steve Wales
First, if you're still able to access at least a part of the database, you would want to take a backup of the tail of the transaction log and save that.

You would restore your full backup from Saturday at 10, with the NORECOVERY option.
You would then restore the most recent differential which based upon your schedule is Tuesday at 10 PM, with the NORECOVERY option.
You would then apply every transaction log from 10PM Tuesday (that first one may have you an error about it not being needed) up until 9 AM Thursday, each with the NORECOVERY option.

Now, if you don't have a tail log backup, you restore your last transaction log backup from 10AM Thursday WITH RECOVERY and you are done with recovery to 10AM and 30 minutes of data loss.

If you do have the tail log backup available, you restore that 10 AM Thursday transaction backup with NORECOVERY and then restore the tail log backup and you're back to the point of failure with no data loss.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
I have a large data set and a SSIS package. How can I load this file in multi threading?

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month