查看SQL Server 2008中的所有事务日志

发布于 2024-07-29 22:57:12 字数 300 浏览 17 评论 0原文

问题是这样的:

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

我怎样才能恢复t3(现在)之后删除的记录? 我希望数据库处于 t0 和 t1 之间的状态。 日志级别为“已满”。

编辑:我已经运行了 DBCC LOG(DB-Name, 3),但日志似乎被截断了。 尽管必须有数千项,但只有 10 项。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冬天旳寂寞 2024-08-05 22:57:12

要重播日志,您始终从完整日志开始,应用差异,然后应用日志备份。 时间线始终从完整备份开始向前,而不是向后。 因此,要达到 t0 之后的状态(即恢复已删除的记录),您需要从 t0 之前进行的完整备份开始,然后应用日志备份并在 t0 停止。

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.

兔姬 2024-08-05 22:57:12

虽然不是理想的解决方案,但您可以尝试将数据库备份恢复到单独的数据库中,比较数据库并手动进行所需的更改。

另一种方法是使用第三方事务日志阅读器,例如 ApexSQL Log

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.

梓梦 2024-08-05 22:57:12

Lance,

事务日志并不是为了查看事务而设计的。 它实际上不是那种日志。 另外,当您进行事务日志备份时,日志文件会被截断,因为信息已备份到文件中。

另外值得一提的是,当您将数据库置于完整恢复模式时,它实际上保持在简单模式,直到您进行完整数据库备份。 因此,如果在 t0 之前未进行备份,则无法返回到该状态。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文