zoukankan      html  css  js  c++  java
  • 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

     

     

     

  • 相关阅读:
    C# 解析json
    Java环境配置
    Wpf学习(五) 数据绑定Binding【小达原创】
    WPF学习(四) 样式 【小达原创】
    jQuery-- 格式化时间
    leetcode -- Nim Game
    Git 学习笔记--拉取远程分支到本地
    Git 学习笔记--删除错误提交的commit
    iOS开发-- 开发中遇到的问题汇总
    Javascript--数组转换成字符串
  • 原文地址:https://www.cnblogs.com/TeyGao/p/3518784.html
Copyright © 2011-2022 走看看