事务日志备份 [英] Transaction Log backup

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

问题描述



有人用错误的数据更新主表,以便找到提交错误的人输出,我使用了事务日志备份文件并使用  sys.fn_dblog读取文件。



现在输出如下所示:






UserName





























当前LSN 交易ID 操作 交易名称 上下文 AllocUnitName 页面ID 插槽ID 开始时间 结束时间 Number of锁 锁定信息
NULL 000b136d:001bd2b8: 015c 0001:2517521c LOP_MODIFY_ROW NULL LCX_PFS dbo。 tblLocMst.IX_missing_tblLocMst 0003:00000001 0 NULL NULL 0  


在此之后,我执行了以下代码来识别用户名等。



SELECT

   操作,

    [交易ID],

    [开始时间],

    [交易名称],

    [交易SID],

    SUSER_SNAME([交易SID])为用户名

FROM

    fn_dblog(NULL,NULL)

WHERE

    [交易ID] ='0001:25177f5e'



    [操作] ='LOP_BEGIN_XACT'



此代码返回执行此错误更新命令的数据库用户(在我的情况下为SA),是否存在我可以通过任何方式找到完成此错误更新的人的IP地址或主机名。



赞赏,


谢谢和问候,


Sheetal。








解决方案



有人有更新主表有错误的数据,为了找到提交错误输出的人,我使用了事务日志备份文件,并使用  sys.fn_dblog。

$读取文件。 b $ b


现在输出如下所示:




































UserName 当前LSN 交易ID 操作 交易名称 上下文 AllocUnitName 页面ID 插槽ID 开始时间 结束时间 Number of锁 锁定信息
NULL 000b136d:001bd2b8: 015c 0001:2517521c LOP_MODIFY_ROW NULL LCX_PFS dbo。 tblLocMst.IX_missing_tblLocMst 0003:00000001 0 NULL NULL 0  


在此之后,我执行了以下代码来识别用户名等。



SELECT

   操作,

    [交易ID],

    [开始时间],

    [交易名称],

    [交易SID],

    SUSER_SNAME([交易SID])为用户名

FROM

    fn_dblog(NULL,NULL)

WHERE

    [交易ID] ='0001:25177f5e'



    [操作] ='LOP_BEGIN_XACT'



此代码返回执行此错误更新命令的数据库用户(在我的情况下为SA),是否存在我可以通过任何方式找到完成此错误更新的人的IP地址或主机名。



赞赏,


谢谢和问候,


Sheetal。









Hi,

Someone has update the master table with wrong data, In order to find the person who commited the wrong output, I have used the Transaction Log Backup file and read the file using sys.fn_dblog.

Now the output looks like below:

UserName Current LSN Transaction ID Operation Transaction Name CONTEXT AllocUnitName Page ID Slot ID Begin Time End Time Number of Locks Lock Information
NULL 000b136d:001bd2b8:015c 0001:2517521c LOP_MODIFY_ROW NULL LCX_PFS dbo.tblLocMst.IX_missing_tblLocMst 0003:00000001 0 NULL NULL 0  

After this, I have executed the below code to identify the User Name etc..

SELECT
    Operation,
    [Transaction ID],
    [Begin Time],
    [Transaction Name],
    [Transaction SID],
    SUSER_SNAME([Transaction SID]) as UserName
FROM
    fn_dblog(NULL, NULL)
WHERE
    [Transaction ID] = '0001:25177f5e'
AND
    [Operation] = 'LOP_BEGIN_XACT'

This code returns the Database User (SA in my case) who executed this wrong update command, Is there any way i can find the IP address or Host name of the person who done this wrong update.

Appreciate,

Thanks and regards,

Sheetal.

解决方案

Hi,

Someone has update the master table with wrong data, In order to find the person who commited the wrong output, I have used the Transaction Log Backup file and read the file using sys.fn_dblog.

Now the output looks like below:

UserName Current LSN Transaction ID Operation Transaction Name CONTEXT AllocUnitName Page ID Slot ID Begin Time End Time Number of Locks Lock Information
NULL 000b136d:001bd2b8:015c 0001:2517521c LOP_MODIFY_ROW NULL LCX_PFS dbo.tblLocMst.IX_missing_tblLocMst 0003:00000001 0 NULL NULL 0  

After this, I have executed the below code to identify the User Name etc..

SELECT
    Operation,
    [Transaction ID],
    [Begin Time],
    [Transaction Name],
    [Transaction SID],
    SUSER_SNAME([Transaction SID]) as UserName
FROM
    fn_dblog(NULL, NULL)
WHERE
    [Transaction ID] = '0001:25177f5e'
AND
    [Operation] = 'LOP_BEGIN_XACT'

This code returns the Database User (SA in my case) who executed this wrong update command, Is there any way i can find the IP address or Host name of the person who done this wrong update.

Appreciate,

Thanks and regards,

Sheetal.


这篇关于事务日志备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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