• Grey Twitter Icon
  • Grey Facebook Icon
  • Grey LinkedIn Icon
  • Grey Google+ Icon

© 2016 - 2019 All rights reserved. PigeonSQL.com | Filip Holub

DBCC CheckDB

January 17, 2017

One of the best practices from Microsoft for SQL Server is a database integrity check. Command DBCC CHECKDB means "Database Consistency Check" and this command checks the physical and logical integrity of all the objects in the databases, if these are not breached database structure.

 

DBCC CHECKDB includes the next three DBCC commands below:

 

• DBCC CHECKCATALOG

• DBCC CHECKALLOC

• DBCC CHECKTABLE

 

1) DBCC CHECKCATALOG - It is used to control the system tables in database.

 

Example : DBCC CHECKCATALOG ('Pigeon')

 

2) DBCC CHECKALLOC - This command checks coherence data pages with indexes.

 

Example : - DBCC CHECKALLOC ('Pigeon', REPAIR_FAST)

                   - DBCC CHECKALLOC ('Pigeon')

 

3) DBCC CHECKTABLE - This we can use to repair each table.

 

Example : - DBCC CHECKTABLE ('Pigeon', REPAIR_REBUILD)

                   - DBCC CHECKTABLE ('Pigeon')

 

When I summarize it all what it checks DBCC CHECKDB:

 

- Coherence Data Pages and indexes

- Data in each table are current

- Consistency database

- Index Views

 

This command should be performed regularly at least once a week.

 

Here is an article how I implemented DBCC CHECKDB on a weekly basis!

 

 

 

 

See you soon!

 

 

Please reload

RECENT POST
Please reload

  • Facebook Social Icon
  • Google+ Social Icon
  • LinkedIn Social Icon
  • Twitter Social Icon