如何恢复fn_dblog函数记录? [英] How to recover fn_dblog function records?
本文介绍了如何恢复fn_dblog函数记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的服务器已重新启动,因此所有数据都在fn_dblog上删除。
我需要知道删除行的数据库表的日期和时间。我尝试使用fn_dblog获取已删除的行详细信息。但是没有记录。因为服务器已重新启动。
任何其他方式获取删除的记录详细信息?
或
如何恢复fn_dblog记录?
My server has restarted, so all data deleted on fn_dblog.
I need to know deleted row's date and time of database table. I try to get deleted rows detail using fn_dblog. but there is no records. because server has restarted.
Any other way to get deleted records detail?
or
How to recover fn_dblog records?
推荐答案
DECLARE @TableName sysname
SET @TableName = 'dbo.Table_1'
SELECT
u.[name] AS UserName
, l.[Begin Time] AS TransactionStartTime
FROM
fn_dblog(NULL, NULL) l
INNER JOIN
(
SELECT
[Transaction ID]
FROM
fn_dblog(NULL, NULL)
WHERE
AllocUnitName LIKE @TableName + '%'
AND
Operation = 'LOP_DELETE_ROWS'
) deletes
ON deletes.[Transaction ID] = l.[Transaction ID]
INNER JOIN
sysusers u
ON u.[sid] = l.[Transaction SID]
这篇关于如何恢复fn_dblog函数记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文