This section provides an overview of a number of database consistency checker (dbcc) commands useful for diagnosing and troubleshooting Adaptive Server problems.
| Note: |
This information also appears in the 11.9.2 Error Messages and Troubleshooting Guide. Unless otherwise specified, all references in this TechNote are to sections of that document. |
Standard dbcc Commands
The standard, supported dbcc commands used in this document are as follows:
For a complete description of these commands, see the System Administration Guide.
Other dbcc Commands
This document utilizes a number of additional dbcc commands. These commands, listed below, are useful in specific troubleshooting situations to gather information and diagnose problems.
Command: dbcc page
Purpose: Prints the contents of a page within a database.
Usage:
dbcc page (dbid, pageno,[printopt [,cache [,logical [,cachename]]]])
dbcc page (dbname, pageno,[printopt [,cache [,logical [,cachename]]]])
dbid - database ID
dbname - database name
pageno - page number
printopt - output format:
0 - print buffer and page header only (default)
1 - print buffer and page headers, rows and
offset table
2 - print buffer and page headers, hex dump
of data and offset table
cache - where to get the page:
0 - read page from disk
1 - read page from cache if present, otherwise
read from disk (default)
logical - the page type
0 - pageno is a virtual page
1 - pageno is a logical page (default)
cachename - the cache name
-1 - all caches
Command: dbcc pglinkage
Purpose: checks the linkage of a page chain.
Usage:
dbcc pglinkage (dbid, start_pg_num, number_pages, printopt, search_for, search_order)
dbid - database ID
start_pg_num - page number at which
to start checking
number_pages - the number of pages to check:
0 - check all pages
printopt - denotes which pages to display:
0 - display only the number of
pages checked
1 - display the last 16 pages checked
2 - display all the page numbers checked
search_for - stop checks when this page number
is reached
search_order - direction of search:
0 - follow previous page pointers
1 - follow next page pointers
Command: dbcc log
Purpose: displays transaction log records.
Usage:
dbcc log (dbid, objid, pageno, rowno, nrecs, type, printopt)
dbid - database ID
objid - can be < 0, zero, or > 0. Meaning of this
option depends on the values of 'pageno'
and/or 'rowno'. For example, if objid >0 and
'pageno' and 'rowno' = 0, all records for
that object are displayed.
pageno - page number (or 0)
rowno - row number (or 0)
nrecs - number of records and log scan direction
type - the type of log record to display
printopt - denotes display options
0 - display header and data
1 - display header only.
Command: dbcc traceflags
(available with 11.0.3 and later)
Purpose: Shows what traceflags, if any, are currently active in the server.
Usage:
dbcc traceflags
Command: dbcc traceon
Purpose: activates the specified trace flag.
Usage:
dbcc traceon (trace_flag)
Command: dbcc traceoff
Purpose: de-activates the specified trace flag.
Usage:
dbcc traceoff (trace_flag)
Command: dbcc memusage
Purpose: Shows memory allocation for server structures and objects, for example the size and number of stored procedures.
Usage:
dbcc memusage
| WARNING! |
Running dbcc memusage on a multi-engine server can cause the other running processes to timeslice. |

Back to Top