Dbcc checkdb help

Discussion in 'SQL Server' started by Neverdiez, Jun 24, 2009.

  1. Neverdiez

    Neverdiez New Member

    Joined:
    Jul 24, 2007
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    0
    Hi guys

    Can you people list all the DBCC CHECKDB codes to repair a database.

    I have consistency errors, I have run the DATA_ALLOW_DATA_LOSS, it fixed a couple but I still have some.
     
  2. sql-programs

    sql-programs New Member

    Joined:
    Oct 21, 2009
    Messages:
    14
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    Software Developer
    Home Page:
    http://www.sql-programmers.com
    DBCC CHECKDB - Check the allocation, and integrity of all objects in a database.

    Code:
    Syntax
          DBCC CHECKDB 
             [( 'database' | database_id | 0
                  [ , NOINDEX 
                      REPAIR_ALLOW_DATA_LOSS
                      REPAIR_FAST
                      REPAIR_REBUILD]
                 )]
             [WITH 
                {
                 [ALL_ERRORMSGS ] [ , NO_INFOMSGS ] [ , TABLOCK ]
                    [, ESTIMATEONLY ] [ , { PHYSICAL_ONLY | DATA_PURITY } ]
                }
             ]
    
     Key:
       NOINDEX        - Skip intensive checks of nonclustered indexes for user tables
       REPAIR_ALLOW_DATA_LOSS - Try to repair all reported errors.
       REPAIR_REBUILD - Perform all repairs that can be performed without risk of data loss.
       ALL_ERRORMSGS  - Return all reported errors per object, default = first 200 errors.
       TABLOCK        - Obtain locks instead of using an internal database snapshot. 
                        this limits the checks that are performed.
       ESTIMATEONLY   - Display the estimated amount of tempdb space that would be required.
       PHYSICAL_ONLY  - Limits the checking to the integrity of the physical structure
       DATA_PURITY    - Check the database for column values that are not valid or out-of-range.
     
    shabbir likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice