如何在SQL Server 2008中查看事务日志 [英] How to view transaction logs in SQL Server 2008

查看:738
本文介绍了如何在SQL Server 2008中查看事务日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 SQL Server 2008 上查看数据库的事务日志,以便找到删除的事务并希望将其回滚.

I need to view the transaction logs of a database on SQL Server 2008 in order to find a delete transaction and hopefully roll it back.

不幸的是,我不知道从哪里开始,而且我发现很难确定Google上哪些文章.

Unfortunately I have no clue where to start, and I'm finding it difficult to determine which are good articles on Google.

我该怎么办?

推荐答案

您可以使用未记录的

DBCC LOG(databasename, typeofoutput)

其中typeofoutput:

where typeofoutput:

0: Return only the minimum of information for each operation -- the operation, its context and the transaction ID. (Default)
1: As 0, but also retrieve any flags and the log record length.
2: As 1, but also retrieve the object name, index name, page ID and slot ID.
3: Full informational dump of each operation.
4: As 3 but includes a hex dump of the current transaction log row.

例如, DBCC LOG(数据库,1)

您也可以尝试使用fn_dblog.

You could also try fn_dblog.

要使用事务日志回滚事务,请查看Stack Overflow帖子

For rolling back a transaction using the transaction log I would take a look at Stack Overflow post Rollback transaction using transaction log.

这篇关于如何在SQL Server 2008中查看事务日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆