View all transaction logs in SQL Server 2008

萝らか妹 提交于 2019-12-10 10:46:44

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!