views:

1710

answers:

2

The problem is this:

t0: Insert is made into my database
t1: Delete is executed
t2: Full backup is made
t3: Transaction log backup is made

How can i recover the deleted record after t3 (which is now)? I want the database in a state between t0 and t1. The log level was Full.

Edit: I have already run DBCC LOG(DB-Name, 3), but the log seems to be truncated. There are only 10 items although there must be thousands.

+4  A: 

To replay log you always start from a full log, apply the differentials and then the log backups. The time line is always forward from the full backup, never backwards. So to get to the state after t0 (ie. recover the deleted record) you start with a full backup that was taken before t0 and then apply the log backups with stop at t0.

Remus Rusanu
can i also view all activity that happened between t0 and t1?
usr
To view activity that occurred between t0 and t1, you stop the log recovery at the time t1 took place. See http://msdn.microsoft.com/en-us/library/ms179451.aspx
Remus Rusanu
+3  A: 

Lance,

The Transaction Log isn't designed to view transactions. It's not really that kind of log. Plus, when you did the transaction log backup, that would have truncated the log file, as the information was backed up to a file.

Also worth mentioning that when you put a database into the Full recovery model, it actually remains in Simple mode until you do a full database backup. Therefore, if no backup was taken prior to t0, then you can't go back to that state.

Rob

Rob Farley