We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
您无法轻松读取事务日志文件,因为该文件没有正确记录。基本上有两种方法可以做到这一点。使用未记录或半记录的数据库函数或使用第三方工具。
注意:只有当您的数据库处于完全恢复模式时,这才有意义。
SQL 函数:
DBCC LOG 和 fn_dblog - 更多详细信息此处 和 此处。
第三方工具:
Toad for SQL Server 和 ApexSQL 日志。
您还可以查看讨论此问题的其他几个主题:
回滚事务使用事务日志
SQL Server 事务日志资源管理器/分析器
读取 SQL Server 2008 中的日志文件 (*.LDF)
You can't read the transaction log file easily because that's not properly documented. There are basically two ways to do this. Using undocumented or semi-documented database functions or using third-party tools.
Note: This only makes sense if your database is in full recovery mode.
SQL Functions:
DBCC LOG and fn_dblog - more details here and here.
Third-party tools:
Toad for SQL Server and ApexSQL Log.
You can also check out several other topics where this was discussed:
Rollback transaction using transaction log
SQL Server Transaction Log Explorer/Analyzer
Read the log file (*.LDF) in SQL Server 2008
我不小心在错误的环境中删除了一大堆数据,这篇文章是我发现的第一个。
因为我同时恐慌并寻找解决方案,所以我选择了我看到的第一件事 - ApexSQL Logs,2000 美元,这是可以接受的成本。
但是,我后来发现 Toad for Sql Server可以从事务日志生成撤消脚本,而且只需 655 美元。
最后,找到了一个更便宜的选项 SysToolsGroup Log Analyzer,只需 300 美元。
I accidentally deleted a whole bunch of data in the wrong environment and this post was one of the first ones I found.
Because I was simultaneously panicking and searching for a solution, I went for the first thing I saw - ApexSQL Logs, which was $2000 which was an acceptable cost.
However, I've since found out that Toad for Sql Server can generate undo scripts from transaction logs and it is only $655.
Lastly, found an even cheaper option SysToolsGroup Log Analyzer and it is only $300.
您可以使用未记录的
where typeofoutput:
例如,DBCC LOG(database, 1)
您也可以尝试 fn_dblog。
要使用事务日志回滚事务,我将查看 StackOverflow 帖子 使用事务日志回滚事务。
You could use the undocumented
where typeofoutput:
For example, DBCC LOG(database, 1)
You could also try fn_dblog.
For rolling back a transaction using the transaction log I would take a look at Stack Overflow post Rollback transaction using transaction log.