DBCC found errors

  • Hi

    One of our integrity check jobs said 'Found 5 errors Repaired 0 errors'

    What do I need to do with this?

    How do I find the errors etc, and what do I do about them?

    Regards

    Deb

  • You should be able to look in the SQL Server Event Log and view the exact error.  Either way though, run DBCC CHECKDB on the affected database in Query Analyzer.  If they are serious enough, you will have to run it again with "allow data loss".  I would backup the database before you do anything else.  Look up DBCC CHECKDB in Books Online to get the full syntax and usage of the command.

    Derrick Leggett
    Mean Old DBA
    When life gives you a lemon, fire the DBA.

  • Deb,

    I had this same problem a few times recently.  Close viewing of the logs & job history showed which table was having the problem.  I had to fix it during our server maintence window.   First I backed up the affected database using the Enterprise Manager.  Then I used SQL query analyzer.  I put the database in single user mode.  Then I had to do a:

     dbcc checkdb ('databasename', REPAIR_ALLOW_DATA_LOSS) with all_errormsgs

    The sql query analyzer shows you the details on what was fixed (might want to save that just in case)

    Next to make sure the repairs worked and that i had no more errors I did a:

    dbcc checkdb ('databasename', REPAIR_REBUILD) with all_errormsgs

    Then put the database back in multi-user mode.  Finally just to be careful I ran another backup of the database.

    I'm not saying this is the only way or best way to deal with this... however I was unable to find any other course of action or better suggestions when I looked into this.

    Best Wishes!

    Paula

  • Before going to the extreme of REPAIR_ALLOW_DATA_LOSS I would try a couple of things. Firstly drop and recreate all the indexes on the table. If this doesn't work, drop the indexes, bcp out the data, drop the table, create the table, bcp in the data, create the indexes.



    Shamless self promotion - read my blog http://sirsql.net

  • Wish I would have heard this suggestion a few weeks ago.  Oh well, live & learn.  Being a newbie and never having done what you suggested before... do you happen to know the link to any online document that goes through those steps?

    Thanks!

    Paula

  • Hi,

    I have had  DBCC errors but mostly were consistency errors.

    I always try the Repair_fast first, then the repair_rebuild and then the REPAIR_ALLOW_DATA_LOSS.

    Obviously the take backups prior to the execution of the dbcc checkdb, have the server in single user mode as well.

    Hope this helps.

    Umesh Chaphekar



    Umesh Chaphekar

    --Every minute you waste someone gains on you ---

  • You guys rock - thanks a ton

    I ran the dbcc in query analyzer and found the tables involved

    Tomorrow I'll try a repair (fast, then rebuild - hopefully that will be enough)

    I'll do a back up first

    Deb

  • I did a backup and I put the database in single user mode

    However when I try to then go into query analyzer to run DBCC I get a login failed

    How can I get myself in once I'm in single user mode

    Thanks

    Deb

  • I am running these steps;

    1. Put the db to be repaired in single user mode

    2.  I Immediately go into query analyzer from enterprise manager and I start the DBCC command

    I then get this error:  Database 'PowerInfo_Nyiso' is already open and can only have one user

    Did you run the DBCC in some other set of steps?

    Regards,

    Deb

  • Ok - I'm in (o;

    It's the simple things! 

    I went into query analyzer *not* using enterprise manager and I'm fine

    THanks

    Deb

  • Deb, Glad to hear it.  So was repair_rebuild enough to fix your errors?  We schedule a repair_rebuild job weekly so that's why I knew my errors would require repair_allow_data_loss to fix them.  However I am going to look into the suggestion of the fellow above also.

  • Yea Deb,

    I thought that was your problem. Both EM and QA were open at the same time.

    Were you able to solve the dbcc issue?

    Umesh



    Umesh Chaphekar

    --Every minute you waste someone gains on you ---

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply