Explain the concepts of Parallel Database consistency check (DBCC).
DBCC CHECKDB verifies the allocation and structural integrity of all the database objects. It performs physical consistency check on indexed views. It is safe as it identifies and corrects maximum errors. DBCC CHECKDB does not enforce any locks on any tables; however, it does lock the schemas that prevent metadata changes. It collects information and scans the log for any changes made, merges the 2 sets of information together to produce a consistent vie of data once it completes. It also checks the linkages, sizes of text, ntext and image pages for every table, and the allocation for all the pages in the database. It performs the following operations on every table:
- Verifies index and data pages are linked correctly.
- Verifies indexes are as per their sort order.
- Verifies consistency of pointers.
- Verifies that every page has reasonable amount of data.
- Verifies page offsets are reasonable.
Explain the concepts of Parallel Database consistency check (DBCC).
DBCC performs a check on the tables and views for any corruptions. The command DBCC CHECKTABLE checks for integrity of the data, index, text, ntext, and image pages for the specified table or indexed view. DBCC checks if the pointers are consistent, data on each page is rational, the offsets of pages are proper and indexes are in their proper sort order. The DBCC CHECKTABLE returns a result set.
Example: To checks the data page integrity of the authors table.
DBCC CHECKTABLE (‘sample’)
GO