Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

588


Part V: Enterprise Data Management


proccache

show_statistics

showcontig

shrinkdatabase

shrinkfile

sqlperf

traceoff

traceon

tracestatus

unpintable

updateusage

useroptions
DBCC execution completed. If DBCC printed error messages,
contact your system administrator.

All DBCC commands report their activity or errors found, and then conclude with the stan-
dard DBCC execution completed statement, including any action that might be needed.

Database Integrity
DBCC CHECKDB performs several operations to check the logical and physical integrity of
the database. It’s critical for the health of the database that the physical structure is cor-
rect. DBCC CHECKDB checks things, such as index pointers, data-page offsets, the linking
between data pages and index pages, and the structural content of the data and index
pages. If a hardware hiccup has left a data page half written, DBCC CHECKDB is the best
means of detecting the problem. The following command executes DBCC CHECKDB on the
AdventureWorks2012 sample database.

DBCC CHECKDB ('AdventureWorks2012');

Result (abridged):

DBCC results for 'AdventureWorks2012'.
Service Broker Msg 9675, State 1: Message Types analyzed: 14.
Service Broker Msg 9676, State 1: Service Contracts analyzed: 6.
Service Broker Msg 9667, State 1: Services analyzed: 3.
Service Broker Msg 9668, State 1: Service Queues analyzed: 3
.
...

c22.indd 588c22.indd 588 7/31/2012 9:24:29 AM7/31/2012 9:24:29 AM


http://www.it-ebooks.info
Free download pdf