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. 解决SpringBoot中webScocket不能注入bean的问题

    最近在做websocket聊天,但是遇到一个问题,就是在websocket的服务中要调用Service层的东西.首先我想到的是通过@Autowire注解来实现bean的注入.但是进过测试发现,注入的b ...

  2. Oracle 数据库的绑定变量特性及应用

    Oracle 数据库的绑定变量特性及应用[-----]转载自https://www.cnblogs.com/rootq/(原地址) 关键词: 绑定变量(binding variable),共享池(sh ...

  3. StringUtils学习

    commons-lang3-3.5.jar

  4. Java中弹出对话框中的几种方式

    1.显示一个错误对话框,该对话框显示的 message 为 'alert': JOptionPane.showMessageDialog(null, "alert", " ...

  5. Laravel 加载自定义的 helpers.php 函数

    Laravel 提供了很多 辅助函数,有时候我们也需要创建自己的辅助函数. 必须 把所有的『自定义辅助函数』存放于 bootstrap 文件夹中. 并在 bootstrap/app.php 文件的最顶 ...

  6. [Selenium]当DOM结构里面有iFrame,iFrame里面是html,怎么send keys to 里面的body,怎么用Assert进行验证?

    我在测试的过程中遇到一个这样的问题,我无法通过CssSelector找到iFrame下边的html: <div id="mailEditorDiv" style=" ...

  7. 中介者模式(QQ聊天室我觉得是个很生动的例子简单易懂)

    设计模式之中介者模式(Mediator) 一.初识中介者模式 那些年,我们一起上过的大学,班级里有班长,有团书记.想一想如果没有QQ这种通讯工具的话,那么班长或者团支书该怎样下达消息呢??同时,班级上 ...

  8. paxos 分布一致性算法的一些资料

    http://blog.csdn.net/russell_tao/article/details/7238783 技术牛人博客 三国背景来讲述分布一致性算法 此人还是NGINX的代码解析 <深入 ...

  9. c:param 标签后不要写 注释 。否则报错 Encountered illegal body of tag "c:import" tag, given its attributes

    c:param 标签后不要写 注释 .否则报错  Encountered illegal body of tag "c:import" tag, given its attribu ...

  10. KBMMW 4.6 正式版发布

    喜大普奔迎新年! Merry Christmas! We are happy to announce the release of kbmMW v. 4.60.00 Professional and ...