locked
Dbcc checkdb command RRS feed

  • Question

  • Dear Sir,

    Here i am having a doubt 

    When we run DBCC CHECKDB command if we found any error we can fix them by using repair_fat,Repair_rebuild,Repair_allow_data_loss.

    If application team not ready for data loss we will restore the backup.if they are not ready to restore the backup also is there any another method to fix this issue.
    Thursday, June 20, 2013 7:27 AM

Answers

  • Dear Sir,

    Here i am having a doubt 

    When we run DBCC CHECKDB command if we found any error we can fix them by using repair_fat,Repair_rebuild,Repair_allow_data_loss.

    If application team not ready for data loss we will restore the backup.if they are not ready to restore the backup also is there any another method to fix this issue.

    Best way to solve consistency error even if data loass is acceptable is to restore from backup but make sure, if your previous backup is corrupted nad u dont have valid backup you can run

    1.REPAIR_REBUILD

    2.If u have noo backup/consistent backup no other means to recover data then run REPAIR_ALLOW_DATA_LOSS as this will delete data while removing inconsistency and will not report anything so u might not be aware what data is deleted

    To check consistency of backup use

    RESRTORE VERIFYONLY FROM DISK='LOCATIONOFBACKUP'


    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

    • Proposed as answer by jakkampudi Thursday, June 20, 2013 1:06 PM
    • Marked as answer by Fanny Liu Thursday, June 27, 2013 10:22 AM
    Thursday, June 20, 2013 7:38 AM
  • One more but it is similar to REPAIR_REBUILD

    REPAIR_FAST Performs minor, nontime-consuming repair actions such as repairing extra keys in nonclustered indexes. These repairs can be done quickly and without risk of data loss.

    Apart from these 3 there is no other for more info

    http://msdn.microsoft.com/en-us/library/aa258278(v=sql.80).aspx

    But i still say restoring from consistent backup is best policy..


    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

    • Proposed as answer by jakkampudi Thursday, June 20, 2013 1:07 PM
    • Marked as answer by Fanny Liu Thursday, June 27, 2013 10:22 AM
    Thursday, June 20, 2013 10:29 AM

All replies

  • Dear Sir,

    Here i am having a doubt 

    When we run DBCC CHECKDB command if we found any error we can fix them by using repair_fat,Repair_rebuild,Repair_allow_data_loss.

    If application team not ready for data loss we will restore the backup.if they are not ready to restore the backup also is there any another method to fix this issue.

    Best way to solve consistency error even if data loass is acceptable is to restore from backup but make sure, if your previous backup is corrupted nad u dont have valid backup you can run

    1.REPAIR_REBUILD

    2.If u have noo backup/consistent backup no other means to recover data then run REPAIR_ALLOW_DATA_LOSS as this will delete data while removing inconsistency and will not report anything so u might not be aware what data is deleted

    To check consistency of backup use

    RESRTORE VERIFYONLY FROM DISK='LOCATIONOFBACKUP'


    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

    • Proposed as answer by jakkampudi Thursday, June 20, 2013 1:06 PM
    • Marked as answer by Fanny Liu Thursday, June 27, 2013 10:22 AM
    Thursday, June 20, 2013 7:38 AM
  • Do  we have any other solutions except these two.
    • Edited by mito access Thursday, June 20, 2013 10:28 AM ....................
    Thursday, June 20, 2013 10:15 AM
  • One more but it is similar to REPAIR_REBUILD

    REPAIR_FAST Performs minor, nontime-consuming repair actions such as repairing extra keys in nonclustered indexes. These repairs can be done quickly and without risk of data loss.

    Apart from these 3 there is no other for more info

    http://msdn.microsoft.com/en-us/library/aa258278(v=sql.80).aspx

    But i still say restoring from consistent backup is best policy..


    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

    • Proposed as answer by jakkampudi Thursday, June 20, 2013 1:07 PM
    • Marked as answer by Fanny Liu Thursday, June 27, 2013 10:22 AM
    Thursday, June 20, 2013 10:29 AM
  • What is the recommendation you are getting when you run CheckDB? It shows the possible fixing option at the end.

    Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
    --------------------------------------------------------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------------------------------------------------------------------
    My Blog | Team Blog | @Twitter

    Thursday, June 20, 2013 11:06 AM
  • Hello,

    It all depends on the type of corruption or error that CheckDB shows. Some errors can be fixed with little to no downtime. Dealing with corruption is a very large and broad topic, if you have specific issues or scenarios please post them.

    -Sean


    Sean Gallardy | Blog | Twitter

    Friday, June 21, 2013 2:14 AM
    Answerer
  • Hallo Mito,

    what EXACTLY do you get as an error from DBCC CHECKDB?
    If it is "only" a non clustered index which may have corrupt data you can repair the nc by rebuilding it.

    This is not possible with clustered index because a rebuild means reading from corrupt pages.
    Best would be posting the dedicated error you get from DBCC CHECKDB

    Can you please run the following command and post the result:

    DECLARE
    DBCC CHECKDB(() WITH ALL_ERRORMSGS, NO_INFOMSGS;

    MCM SQL Server 2008 MCSE - SQL Server 2012 MCSA - SQL Server 2012 db Berater GmbH http://www-db-berater.de SQL Server Blog (german only)

    Friday, June 21, 2013 4:05 AM