DBCC CHECKDB command in Microsoft Sql Server

DBCC CHECKDB in Microsoft Sql Server

Checks the allocation and structural integrity of all the objects in the specified database.

Syntax:

DBCC CHECKDB     ( 'database_name'             [ , NOINDEX
| { REPAIR_ALLOW_DATA_LOSS
| REPAIR_FAST
| REPAIR_REBUILD
} ]
)

For each table in the database, DBCC CHECKDB checks that:
• Index and data pages are correctly linked.
• Indexes are in their proper sort order.
• Pointers are consistent.
• The data on each page is reasonable.
• Page offsets are reasonable.

Examples

-- Check the current database.
DBCC CHECKDB
GO
-- Check the pubs database without nonclustered indexes.
DBCC CHECKDB ('pubs', NOINDEX)
GO

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s