问题
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.
回答1:
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.
回答2:
Although not an ideal solution you can try restoring database backup into separate database, compare databases and make needed changes manually.
Another way is to use a third party transaction log reader such as ApexSQL Log.
回答3:
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
来源:https://stackoverflow.com/questions/1210010/view-all-transaction-logs-in-sql-server-2008