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

DBCC--LOG的更多相关文章

  1. DBCC常用命令小汇

    DBCC是SQL Server提供的一组控制台命令,功能很强大,掌握一些必要的语句,对操作数据库有不少帮助,所以决定整理一下,发现已有不少类似的整理,减少了不少工作,归类如下: 一.DBCC 帮助类命 ...

  2. sqlserver log

    DBCC LOGINFODBCC log('QSSys', TYPE=2)goselect * from sys.fn_dblog(null,null)select [Dirty Pages],[Mi ...

  3. DBCC用法汇总

    本文摘自http://www.cnblogs.com/lilycnblogs/archive/2011/03/31/2001372.html 留作查阅 DBCC是SQL Server提供的一组控制台命 ...

  4. DBCC命令

    DBCC SQLMGRSTATS 用于产生3个不同的值,这些值用在你想查看高速缓存在ad-hoc和预编译的TSQL语句中是如何工作的 Memory Used(8K Pages):若内存页的数量非常大, ...

  5. List Available DBCC Commands

    DBCC Commands or Database Consistency Checker commands have been with SQL Server from its early ages ...

  6. DBCC - Undocumented commands

    These commands may affect system performance and/or force table-level locks.There is no guarantee th ...

  7. DBCC维护语句语法

    一.DBCC维护语句:对数据库.索引或文件组进行维护的任务--1.DBCC CLEANTABLE,回收删除的可变长度列和文本列的空间 DBCC CLEANTABLE  ( { 'database_na ...

  8. SQL Server 2000 ——DBCC命令

    http://blog.163.com/ruifeng_00/blog/static/6904584200971291923462/   一.定义 微软当初从SYBASE将DBCC是作为数据库一致性检 ...

  9. 几个未公开的 DBCC 命令

    http://blog.csdn.net/CathySun118/article/category/538610 https://ask.hellobi.com/blog/lyhabc/1612 1. ...

  10. SQLSERVER DBCC命令大全

    DBCC DROPCLEANBUFFERS:从缓冲池中删除所有缓存,清除缓冲区 在进行测试时,使用这个命令可以从SQLSERVER的数据缓存data cache(buffer)清除所有的测试数据,以保 ...

随机推荐

  1. poj1182(带权并查集)

    题目链接:http://poj.org/problem?id=1182 题意:题目告诉有  3  种动物,互相吃与被吃,现在告诉你  m  句话,其中有真有假,叫你判断假的个数  (  如果前面没有与 ...

  2. 慕课网access_token的获取(下)

    接口调用返回的结果是两个字段:access_token和expires_in,所以需要创建一个实体类封装这两个字段 运行测试类WeixinTest.java控制台打印出错误信息 重置开发者密钥试试看 ...

  3. ECMAScript5之JSON对象属性的遍历顺序

    测试浏览器 Chrome.Safari 一 键可以用parseInt解析成整数的,按数值升序顺序. var intObj = { '3.3' : 3.3, '2' : 222, '1' :111 } ...

  4. Python调shell

    os.system(cmd) 函数返回cmd的结束状态码,阻塞调用. os.popen(cmd) 函数返回cmd的标准输出,阻塞调用. (status, output) = commands.gets ...

  5. PAT L2-010 排座位(floyd)

    布置宴席最微妙的事情,就是给前来参宴的各位宾客安排座位.无论如何,总不能把两个死对头排到同一张宴会桌旁!这个艰巨任务现在就交给你,对任何一对客人,请编写程序告诉主人他们是否能被安排同席. 输入格式: ...

  6. 重哈希 · rehashing

    [抄题]: [思维问题]: [一句话思路]: [输入量]:空: 正常情况:特大:特小:程序里处理到的特殊情况:异常情况(不合法不合理的输入): [画图]: newindex = (hashTable[ ...

  7. [leetcode]295. Find Median from Data Stream数据流的中位数

    Median is the middle value in an ordered integer list. If the size of the list is even, there is no ...

  8. Java多线程超详细总结

    目录(?)[-] 一扩展javalangThread类 二实现javalangRunnable接口 三Thread和Runnable的区别 四线程状态转换 五线程调度 六常用函数说明 使用方式 为什么 ...

  9. filter 死循环(tomcat 启动完成 ,自动执行filter.dofilter,导致tomcat 启动超时) , tomcat 启动和 servers 启动 不同

    package com.diancai.interceptor; import java.io.IOException; import javax.servlet.Filter; import jav ...

  10. Pseudo-class和pseudo-element的差别

    相同点: Pseudo-class和pseudo-element的语法都是以selector或者selector.class开始的. 不同点: Pseudo-class的操作对象是文档树中已有的元素, ...