• DBCC--LOG


    DBCC LOG
    To retrieve the transaction log for a given database.
    对应日志文件较大的数据库,慎用该命令
    Uasge:
    DBCC LOG(<dbid|dbname>,<formatid>)

    formatid:
    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 [ (@dbid, @objid, @pagenum, @rownum, @records, @type [, @printopt]) ]

    dbcc log (5, 0, 0, 0, -1, 0, 1) // Show the last begin transaction record in the log

    Parameters:
    @dbid Database ID
    @objid Object ID
    A negative value indicates that @pagenum & @rownum represent a row in the log to use as a starting point in the scan of the log.
    A value of zero indicates that log records for changes to @pagenum will be included in the commands output.
    A positive value followed by a non-zero value for @pagenum indicates that @pagenum and @rownum represent a transaction ID. Log records for that transaction will be included in the output.
    A positive value followed by zero values for @pagenum and @rownum indicates an object ID. Log records for changes to that object will be included in the output.
    @pagenum page number
    @rownum row number in the log
    Together with @pagenum, this is either a starting point in a scan of the log or a transaction id.
    @records number of records to examine. If positive, the first
    @type 
    @printopt

    --==============================================================================

    使用fn_dblog或sys.fn_dump_dblog来查看日志

    SELECT * FROM sys.fn_dblog(@StartingLSN, @EndingLSN)

    @StartingLSN和@EndingLSN可以为null

     

     

     

  • 相关阅读:
    Centos 6.5 在 Dell 服务器安装的记录
    【转载】你真的了解补码吗
    【转载】我对补码的理解
    记录一下家里双路由实现wifi漫游功能
    中国大学MOOC | C语言程序设计入门 第8周编程练习 翁恺
    华为卡刷包线刷方法
    串口通信
    端口复用和端口重映射
    软件仿真和硬件仿真
    FPGA之四位LED灯
  • 原文地址:https://www.cnblogs.com/TeyGao/p/3518784.html
Copyright © 2020-2023  润新知