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

1. DBCC BUFFER

This command can be used to display buffer headers and pages from the buffer cache.
Syntax: 
dbcc buffer ([dbid|dbname] [,objid|objname] [,nbufs], [printopt])

where

dbid|dbname   - database id|database name

objid|objname - object id|object name

nbufs         - number of buffers to examine

printopt      - print option

0 - print out only the buffer header and page header

(default)

1 - print out each row separately and the offset table

2 - print out each row as a whole and the offset table

This is the example:

DBCC TRACEON (3604)

dbcc buffer(master,'sysobjects')

2. DBCC BYTES

This command can be used to dump out bytes from a specific address.
Syntax: 
dbcc bytes ( startaddress, length )

where

startaddress  - starting address to dump

length         - number of bytes to dump

This is the example:

DBCC TRACEON (3604)

dbcc bytes (10000000, 100)

3. DBCC DBINFO

Displays DBINFO structure for the specified database.
Syntax: 
DBCC DBINFO [( dbname )]

where

dbname - is the database name.

This is the example:

DBCC TRACEON (3604)

DBCC DBINFO (master)

4. DBCC DBTABLE

This command displays the contents of the DBTABLE structure.
Syntax: 
DBCC DBTABLE ({dbid|dbname})

where

dbid|dbname  - database name or database ID

This is the example:

DBCC TRACEON (3604)

DBCC DBTABLE (master)

The DBTABLE structure has an output parameter called dbt_open. This parameter keeps track of how many users are in the database.
Look at here for more details: FIX: Database Usage Count Does Not Return to Zero

5. DBCC DES

Prints the contents of the specified DES (descriptor).
Syntax: 
dbcc des [( [dbid|dbname] [,objid|objname] )]

where

dbid|dbname   - database id|database name.

objid|objname - object id|object name

This is the example:

DBCC TRACEON (3604)

DBCC DES

6. DBCC HELP

DBCC HELP returns syntax information for the specified DBCC statement. In comparison with DBCC HELP command in version 6.5, it returns syntax information only for the documented DBCC commands.
Syntax: 
DBCC HELP ('dbcc_statement' | @dbcc_statement_var | '?') 
This is the example:

DBCC TRACEON (3604)

DECLARE @dbcc_stmt sysname

SELECT @dbcc_stmt = 'CHECKTABLE'

DBCC HELP (@dbcc_stmt)

7. DBCC IND

Shows all pages in use by indexes of the specified table.
Syntax: 
dbcc ind( dbid|dbname, objid|objname, printopt = {-2|-1|0|1|2|3} )

where

dbid|dbname   - database id|database name.

objid|objname - object id|object name

printopt      - print option

There is change in this command in how it is used in SQL Server 7.0, in that the printopt parameter is now no longer optional.
This is the example:

DBCC TRACEON (3604)

DBCC IND (master, sysobjects, 0)

8. DBCC log

This command is used to view the transaction log for the specified database.
Syntax: 
DBCC log ( {dbid|dbname}, [, type={-1|0|1|2|3|4}] )

PARAMETERS:

Dbid or dbname - Enter either the dbid or the name of the database

in question.

type - is the type of output:

0 - minimum information (operation, context, transaction id)

1 - more information (plus flags, tags, row length, description)

2 - very detailed information (plus object name, index name,

page id, slot id)

3 - full information about each operation

4 - full information about each operation plus hexadecimal dump

of the current transaction log's row.

-1 - full information about each operation plus hexadecimal dump

of the current transaction log's row, plus Checkpoint Begin,

DB Version, Max XDESID

by default type = 0

To view the transaction log for the master database, run the following command:
DBCC log (master)

9. DBCC PAGE

You can use this command to view the data page structure.
Syntax: 
DBCC PAGE ({dbid|dbname}, pagenum [,print option] [,cache] [,logical])

PARAMETERS:

Dbid or dbname - Enter either the dbid or the name of the database

in question.

Pagenum - Enter the page number of the SQL Server page that is to

be examined.

Print option - (Optional) Print option can be either 0, 1, or 2.

0 - (Default) This option causes DBCC PAGE to print

out only the page header information.

1 - This option causes DBCC PAGE to print out the

page header information, each row of information

from the page, and the page's offset table. Each

of the rows printed out will be separated from

each other.

2 - This option is the same as option 1, except it

prints the page rows as a single block of

information rather than separating the

individual rows. The offset and header will also

be displayed.

Cache - (Optional) This parameter allows either a 1 or a 0 to be

entered.

0 - This option causes DBCC PAGE to retrieve the page

number from disk rather than checking to see if it is

in cache.

1 - (Default) This option takes the page from cache if it

is in cache rather than getting it from disk only.

Logical - (Optional) This parameter is for use if the page number

that is to be retrieved is a virtual page rather then a

logical page. It can be either 0 or 1.

0 - If the page is to be a virtual page number.

1 - (Default) If the page is the logical page number.

This is the example:

DBCC TRACEON (3604)

DBCC PAGE (master, 1, 1)

Look at here for more details: Data page structure in MS SQL 6.5

10. DBCC procbuf

This command displays procedure buffer headers and stored procedure headers from the procedure cache.
Syntax: 
DBCC procbuf( [dbid|dbname], [objid|objname], [nbufs], [printopt = {0|1}] )

where

dbid|dbname   - database id|database name.

objid|objname - object id|object name

nbufs         - number of buffers to print

printopt - print option

(0  print out only the proc buff and proc header (default)

1  print out proc buff, proc header and contents of buffer)

This is the example:

DBCC TRACEON (3604)

DBCC procbuf(master,'sp_help',1,0)

11. DBCC prtipage

This command prints the page number pointed to by each row on the specified index page.
Syntax: 
DBCC prtipage( dbid, objid, indexid, indexpage )

where

dbid      - database ID

objid     - object ID

indexid   - index ID

indexpage - the logical page number of the index page to dump

This is the example:

DBCC TRACEON (3604)

DECLARE @dbid int, @objectid int

SELECT @dbid = DB_ID('master')

SELECT @objectid = object_id('sysobjects')

DBCC prtipage(@dbid,@objectid,1,0)

12. DBCC pss

This command shows info about processes currently connected to the server.
Syntax: 
DBCC pss( suid, spid, printopt = { 1 | 0 } )

where

suid     - server user ID

spid     - server process ID

printopt - print option

(0  standard output,

1  all open DES's and current sequence tree)

This is the example:

DBCC TRACEON (3604)

dbcc pss

13. DBCC resource

This command shows the server's level RESOURCE, PERFMON and DS_CONFIG information. RESOURCE shows addresses of various data structures used by the server. PERFMON structure contains master..spt_monitor field info. DS_CONFIG structure contains master..syscurconfigs field information.
Syntax: 
DBCC resource 
This is the example:

DBCC TRACEON (3604)

DBCC resource

14. DBCC TAB

You can use the following undocumented command to view the data pages structure (in comparison with DBCC PAGE, this command will return information about all data pages for viewed table, not only for particular number).
Syntax: 
DBCC tab (dbid, objid)

where

dbid  - is the database id

objid - is the table id

This is the example:

DBCC TRACEON (3604)

DECLARE @dbid int, @objectid int

SELECT @dbid = DB_ID('master')

SELECT @objectid = object_id('sysdatabases')

DBCC TAB (@dbid,@objectid)

 

几个未公开的 DBCC 命令的更多相关文章

  1. Sql Server之旅——第五站 确实不得不说的DBCC命令(文后附年会福利)

    今天研发中心办年会,晚上就是各自部门聚餐了,我个人喜欢喝干红,在干红中你可以体味到那种酸甜苦辣...人生何尝不是这样呢???正好 ceo从美国带了干红回来,然后我就顺道开心的过了把瘾....一个字.. ...

  2. Sql Server之旅——第五站 确实不得不说的DBCC命令

    原文:Sql Server之旅--第五站 确实不得不说的DBCC命令 今天研发中心办年会,晚上就是各自部门聚餐了,我个人喜欢喝干红,在干红中你可以体味到那种酸甜苦辣...人生何尝不是这样呢???正好 ...

  3. SQL Server 2000 ——DBCC命令

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

  4. Sql Server中的DBCC命令详细介绍

    一:DBCC 1:什么是DBCC 我不是教学老师,我也说不到没有任何无懈可击的定义,全名:Database Console Commands.顾名思义“数据库控制台命令”,说到“控制台“,我第一反应就 ...

  5. DBCC命令

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

  6. SQLSERVER DBCC命令大全

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

  7. [转帖]SQL Server DBCC命令大全

    SQL Server DBCC命令大全   原文出处:https://www.cnblogs.com/lyhabc/archive/2013/01/19/2867174.html DBCC DROPC ...

  8. SQL Server DBCC命令大全

    原文出处:https://www.cnblogs.com/lyhabc/archive/2013/01/19/2867174.html DBCC DROPCLEANBUFFERS:从缓冲池中删除所有缓 ...

  9. 微软未公开的 SP

    一些用在SQL 2000的企业管理GUI中,并且不打算用于其他的流程.微软已预计将其中的一些存储过程从未来的SQL Server版本中删除(或已经删除了).虽然这些存储过程可能很有用并为你节省了很多时 ...

随机推荐

  1. php 学习try_catch测试抛出异常

    /** * Class show * 一个catch接收抛出异常 */ class show { // 错误的演示 //try { //require ('test_try_catch.php'); ...

  2. /proc文件夹介绍

    Linux系统上的/proc目录是一种文件系统,即proc文件系统.与其它常见的文件系统不同的是,/proc是一种伪文件系统(也即虚拟文件系统),存储的是当前内核运行状态的一系列特殊文件,用户可以通过 ...

  3. Mysql修改语句的运行流程

    执行修改语句前要先连接数据库,这是连接器的工作. 接下来,分析器会通过词法和语法解析知道这是一条更新语句.优化器决定要使用 ID 这个索引.然后,执行器负责具体执行,找到这一行,然后更新. Mysql ...

  4. SGU 217. Two Cylinders

    题意:给空间内两根圆柱,求轴线垂直相交时公共部分的体积. 暴力积分即可. ID: Date'n'Time: Name: Task: .Ext: Status: Time: Memory: 158937 ...

  5. 1-4 TCP/IP协议族

    网络协议是在内核中实现的,socket是对tcp/ip协议的系统调用,提供以下两点功能: 1. 将应用撑血数据从用户缓冲区中复制到TCP/UDP内核发送缓冲区,以交付内核发送来的数据(比如send), ...

  6. linux 把ls -R格式化成树状结构

    谁能写脚本把linux中的ls -R命令的结果格式化成树状结构? 最好是shell脚本!欢迎讨论! 参与讨论有可能意外获取iPhone6哦~~

  7. thinkphp5.0配置作用域

    作用域 配置参数支持作用域的概念,默认情况下,所有参数都在同一个系统默认作用域下面.如果你的配置参数需要用于不同的项目或者相互隔离,那么就可以使用作用域功能,作用域的作用好比是配置参数的命名空间一样. ...

  8. PHP获取以为数组中的最大值和最小值

    1.PHP获取一维数组中的最大值 <?php $a=array('1','3','55','99'); $pos = array_search(max($a), $a); echo $a[$po ...

  9. 湖南大学ACM程序设计新生杯大赛(同步赛)B - Build

    题目描述 In country  A, some roads are to be built to connect the cities.However, due to limited funds, ...

  10. EOJ 3256 拼音魔法

    模拟. 有$a$先标$a$,其次是$o$和$e$,$o$和$e$在韵母中不会同时存在.最后是$u$和$i$,这两个字母在韵母中可能同时存在,标在后面的那个.输出那些字符的话直接输出就可以了. 举几个例 ...