【转贴收藏】sql2000 undoocumented DBCC Commands
2020-07-21 04:14
936 查看
Some Useful Undocumented SQL Server 7.0 and 2000 DBCC Commands
Alexander Chigrik
chigrik@mssqlcity.com
DBCC is an abbreviation for Database Console Command. DBCC commands are generally used to check the physical and logical consistency of a database, although they are also used for a variety of miscellaneous tasks, as you will see here.
Note, the command:
DBCC TRACEON (3604)
is issued before each of the following DBCC examples in order to better demonstrate the effects of the command by displaying a trace of the output of the DBCC command. It is not actually required to run the DBCC commands examined below. If you run any of the DBCC commands below without the above option, the command runs, but you don't see what it is doing.
Undocumented DBCC commands
Here you can find some useful undocumented DBCC commands.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 |
DBCC TRACEON (3604) |
2. DBCC BYTES
This command can be used to dump out bytes from a specific address.Syntax:
dbcc bytes ( startaddress, length )
where |
DBCC TRACEON (3604) |
3. DBCC DBINFO
Displays DBINFO structure for the specified database.Syntax:
DBCC DBINFO [( dbname )]
where |
DBCC TRACEON (3604) |
4. DBCC DBTABLE
This command displays the contents of the DBTABLE structure.Syntax:
DBCC DBTABLE ({dbid|dbname})
where |
DBCC TRACEON (3604) |
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 |
DBCC TRACEON (3604) |
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) |
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 |
This is the example:
DBCC TRACEON (3604) |
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: |
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: |
DBCC TRACEON (3604) |
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 |
DBCC TRACEON (3604) |
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 |
DBCC TRACEON (3604) |
12. DBCC pss
This command shows info about processes currently connected to the server.Syntax:
DBCC pss( suid, spid, printopt = { 1 | 0 } )
where |
DBCC TRACEON (3604) |
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) |
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 |
DBCC TRACEON (3604) |
转载于:https://www.cnblogs.com/StevenLi/archive/2010/08/19/1803137.html
相关文章推荐
- 【转贴收藏】sql2000 undoocumented DBCC Commands
- 【转贴收藏】SQL常用语句,含查看数据库日志
- 转贴:Oracle中的 UPDATE FROM 解决方法收藏
- Delphi编程注意事项---转贴收藏
- DBGridEH控件使用说明--收藏转贴
- 【转贴收藏】c#高性能在WEB端产生验证图片
- 今天就出发 [转贴/收藏]
- 还想买房的看看了,尖峰时刻之房价真相:上海vs东京。[转贴/收藏]
- JS刷新父窗口的几种方式 (转贴收藏)http://www.cnblogs.com/wubin264/archive/2009/02/19/1394264.html
- Thread大全---转贴收藏
- Delphi指针大全---转贴收藏
- 被腾讯拒收 [转贴/收藏]
- 大学宿舍,中国最昂贵的房价![转贴/收藏]
- [转贴收藏]Eclipse Tomcat Jasper 入门
- [转贴]ASP与数据库应用(给初学者)以及一些精华收藏
- 安装FastMM------转贴收藏
- 读取sql2000,sql2005中的表结构[转贴]
- [转贴]gcc内嵌汇编简介收藏
- SQL2000的DBCC数据修复过程
- [转贴收藏]XSLT MUENCHIAN分组法