What are all the dbcc commands for SQL Server?

A. All the documented ones are in the books online, or in publicly accessible knowledgebase articles. The rest are undocumented because they are either irrelevant to people outside MS, or their use is dangerous and is to be discouraged.

The undocumented dbcc commands vary from release to release and there are sure to be a lot more new ones in SQL 7.0 as well as ones that have been removed.

However as people always want to know, here is a predominantly Sybase based list that will mostly work with SQL 6.5 and below - however there are no guarantees. Which will work against SQL 7.0 is even more of a lottery.

Feel free to use any of these against a test system, but don't expect any help if you use any of them that are not documented officially elsewhere.

  • allocdump( dbid, page )
  • bhash( \{ print_bufs | no_print \}, bucket_limit )
  • buffer( \[ dbid \]\[, objid \]\[, nbufs \], printopt=\{ 0 | 1 | 2 \}, buftype )
  • bytes( startaddress, length )
  • checkalloc\[( dbname \[, fix | nofix \] ) \]
  • checkcatalog\[( dbname )\]
  • checkdb\[( dbname \[, skip_ncindex \] ) \]
  • checktable( tablename | tabid \[, skip_ncindex \] )
  • dbinfo( \[ dbname \] )
  • dbrepair( dbid, option=\{ dropdb | fixindex | fixsysindex \}, table, indexid )
  • dbtable( dbid )
  • delete_row( dbid, pageid, delete_by_row=\{ 1 | 0 \}, rownum )
  • des( \[ dbid \]\[, objid \] )
  • extentcheck( dbid, objid, indexid, sort=\{1|0\} )
  • extentchain( dbid, objid, indexid, sort=\{1|0\},display(1,0) )
  • extentdump( dbid, page )
  • extentzap( dbid, objid, indexid, sort )
  • findnotfullextents( dbid, objid, indexid, sort=\{ 1 | 0 \} )
  • fix_al( \[ dbname \] )
  • help( dbcc_command )
  • ind( dbid, objid, printopt=\{ 0 | 1 | 2 \} )
  • indexalloc(tablename|tabid, indid, \[full | optimized | fast\],\[fix | nofix\])
  • locateindexpgs( dbid, objid, page, indexid, level )
  • lock
  • log( \[dbid\]\[,objid\]\[,page\]\[,row\]\[,nrecords\]\[,type=\{-1..36\}\],printopt=\{0|1\} )
  • memusage
  • netmemshow( option=\{1 | 2 | 3\} )
  • netmemusage
  • newalloc( dbname, option=\{ 1 | 2 | 3 \} )
  • page( dbid, pagenum \[, printopt=\{0|1|2\} \]\[, cache=\{0|1\} \]\[, logical=\{1|0\} \] )
  • pglinkage( dbid, start, number, printopt=\{0|1|2\}, target, order=\{1|0\} )
  • pktmemshow( option=\{spid\} )
  • procbuf( dbid, objid, nbufs, printopt=\{ 0 | 1 \} )
  • prtipage( dbid, objid, indexid, indexpage )
  • pss( suid, spid, printopt=\{ 1 | 0 \} )
  • rebuildextents( dbid, objid, indexid )
  • resource
  • show_bucket( dbid, pageid, lookup_type )
  • tab( dbid, objid, printopt=\{ 0 | 1 | 2 \} )
  • tablealloc(tablename|tabid, \[full | optimized | fast\],\[fix | nofix\])
  • traceoff( tracenum \[, tracenum ... \] )
  • traceon( tracenum \[, tracenum ... \] )
  • undo( dbid, pageno, rowno )

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish