Google News
logo
SQL Server - Interview Questions
What is the DBCC command and why is it used?
DBCC stands for database consistency checker. This command is used to check the consistency of the database. DBCC command help to review and monitoring the maintenance of tables, database, and for validation of operations done on the database, etc. For example:
 
DBCC CHECKDB : It makes sure that table in the database and the indexes are correctly linked.
 
DBCC CHECKALLOC : It checks all pages in the database and makes sure that all are correctly allocated.
 
DBCC CHECKFILEGROUP : It checks all table file group for any damage.
 
IF the user executes the above commands, a database snapshot is created through the database engine, and it continues in the consistent transactional state. After that, It runs the checks against stored database snapshot, and after the completion of the command, it dropped the snapshot.
Advertisement