SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Understanding DBCC CHECKDB, to deal with corrupt database

Database files are volatile, constantly being changed and updated, so that, like any other volatile files in the system, there is potential for them to become corrupt. Because of this, it is necessary to perform periodic maintenance, to validate the allocation, logical, and structural integrity of the objects in the database. In SQL Server, we can use Database Consistency Checker (DBCC) CHECKDB to check the storage of the database data on the hard disk. It is recommended to run the DBCC CHECKDB regularly against user databases because it guarantees the structural integrity of the data by checking the storage of the database data on the hard disk.

The DBCC CHECKDB command performs the following checks:

  • Executes DBCC CHECKALLOC – check the disk allocation structures for the database.
  • Checks Service Broker objects.
  • Checks the contents of each indexed view.
  • Executes DBCC CHECKCATALOG – verify consistency of system metadata.
  • Executes DBCC CHECKTABLE – check the structures and pages that store tables or indexed views.

Check out my article (ie. Understanding DBCC CHECKDB Command to Deal with Corrupt Database), in which I discussed, what are the parameters of DBCC CHECKDB command and how we can use its options to repair corrupt database.

This article is published on SSWUG.org.

Basit's SQL Server Tips

Basit Farooq is a Lead Database Administrator, Trainer and Technical Author. He has more than a decade of IT experience in development, technical training and database administration on Microsoft SQL Server platforms. Basit has authored numerous SQL Server technical articles, and developed and implemented many successful database infrastructure, data warehouse and business intelligence projects. He holds a master's degree in computer science from London Metropolitan University, and industry standard certifications from Microsoft, Sun, Cisco, Brainbench, Prosoft and APM, including MCITP Database Administrator 2008, MCITP Database Administrator 2005, MCDBA SQL Server 2000 and MCTS .NET Framework 2.0 Web Applications.


Leave a comment on the original post [basitaalishan.com, opens in a new window]

Loading comments...