Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Database Recovery after mistaken restore

Posted on 2013-06-29
3
Medium Priority
?
354 Views
Last Modified: 2013-06-29
Hello experts,

We have a SQL 2005 database with recovery model set to simple. The database name is DB3.

The most recent backup for this DB is at 5:00AM today.

By mistake, I restored another database (DB1) to DB3 by write clicking on DB3 in Management Studio, choosing restore, and restoring from DB1. ( I was trying to restore DB2, not 3).

Now I see that DB3 Data file size is 815MB, and Log file size is 236MB.

Is there any chance to restore the recent DB activity from morning till the restore time? If not, I will ask users to re-apply their today work.

You early reply is highly appreciated.
0
Comment
Question by:Muhajreen
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
Racim BOUDJAKDJI earned 2000 total points
ID: 39286808
Let's keep it simple:
>If you overwrote DB3 and DB3 was on SIMPLE recovery mode, then you can get the version up to the last DB3 full backup.  
> If you overwrote DB3 and DB3 was on FULL recovery mode, then you can get the version up to the last DB3 full backup and apply the logs up to the  last log backup before you overwrote DB3 by mistake.
> If you overwrote DB3 and do not have a full backup, you lost the data
> You can restore DB1 and overwrite DB2 as many times as you want from your last DB1 backup

Hope this helps.
0
 

Author Comment

by:Muhajreen
ID: 39286979
How to determine if my DB3 was on SIMPLE recovery mode? After restore I found it's recovery mode set to SIMPLE. Does that mean it was in simple before restore too?

Haytham
0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 39287098
After restore I found it's recovery mode set to SIMPLE. Does that mean it was in simple before restore too?
Unless somebody changed it after the restore, yes.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question