i need view the deleted records (rows) from a sql server table, actually i am using this command
我需要从sql server表中查看已删除的记录(行),实际上我正在使用此命令
DBCC LOG(MyDatabase,-1)
to view the log, but i don't understand the output format.
查看日志,但我不明白输出格式。
exist any free tool to translate the log file of an Sql server database or any documentation wich how interpret the information showed by the command DBCC LOG
存在任何免费工具来翻译Sql server数据库的日志文件或任何文档如何解释命令DBCC LOG所显示的信息
i' am using SQL server 2008.
我正在使用SQL Server 2008。
UPDATE
UPDATE
My objective is not recover the deleted records, i just wanna see the deleted records or the delete command executed.
我的目标是不恢复已删除的记录,我只想看到已删除的记录或执行的删除命令。
Thanks in advance.
提前致谢。
3 个解决方案
#1
4
It can be done as a learning exercise, although documentation is slim to none. I have decoded an example of a deletion before, as well as an update and a few other items from the log.
虽然文档很少,但它可以作为学习练习来完成。我之前已经解码了删除的示例,以及日志中的更新和一些其他项目。
http://sqlfascination.com/2010/02/03/how-do-you-decode-a-simple-entry-in-the-transaction-log-part-1/
http://sqlfascination.com/2010/02/03/how-do-you-decode-a-simple-entry-in-the-transaction-log-part-1/
Given the length of the explanation, it's not suitable to just re-post it here.
鉴于解释的长度,不适合在此处重新发布。
#2
5
Data you are getting from DBCC LOG are in HEX format and you’ll need to convert them in order to become readable.
您从DBCC LOG获取的数据是HEX格式,您需要转换它们才能变得可读。
You can also try using fn_dblog function to read transaction log but you’ll get pretty much the same results that need to be decoded.
您也可以尝试使用fn_dblog函数来读取事务日志,但是您将得到几乎相同的需要解码的结果。
There is also a third party tool ApexSQL Log that can read transaction log and show all logged commands but it comes with a price.
还有第三方工具ApexSQL Log可以读取事务日志并显示所有已记录的命令,但它需要付出代价。
#3
2
Here is a step by step guide with all SQL code provided to read the database online transaction log using undocumented SQL function fn_dblog
这是一个循序渐进的指南,提供所有SQL代码,使用未记录的SQL函数fn_dblog读取数据库联机事务日志
How to recover deleted data from SQL Server
如何从SQL Server恢复已删除的数据
#1
4
It can be done as a learning exercise, although documentation is slim to none. I have decoded an example of a deletion before, as well as an update and a few other items from the log.
虽然文档很少,但它可以作为学习练习来完成。我之前已经解码了删除的示例,以及日志中的更新和一些其他项目。
http://sqlfascination.com/2010/02/03/how-do-you-decode-a-simple-entry-in-the-transaction-log-part-1/
http://sqlfascination.com/2010/02/03/how-do-you-decode-a-simple-entry-in-the-transaction-log-part-1/
Given the length of the explanation, it's not suitable to just re-post it here.
鉴于解释的长度,不适合在此处重新发布。
#2
5
Data you are getting from DBCC LOG are in HEX format and you’ll need to convert them in order to become readable.
您从DBCC LOG获取的数据是HEX格式,您需要转换它们才能变得可读。
You can also try using fn_dblog function to read transaction log but you’ll get pretty much the same results that need to be decoded.
您也可以尝试使用fn_dblog函数来读取事务日志,但是您将得到几乎相同的需要解码的结果。
There is also a third party tool ApexSQL Log that can read transaction log and show all logged commands but it comes with a price.
还有第三方工具ApexSQL Log可以读取事务日志并显示所有已记录的命令,但它需要付出代价。
#3
2
Here is a step by step guide with all SQL code provided to read the database online transaction log using undocumented SQL function fn_dblog
这是一个循序渐进的指南,提供所有SQL代码,使用未记录的SQL函数fn_dblog读取数据库联机事务日志
How to recover deleted data from SQL Server
如何从SQL Server恢复已删除的数据