Major Noob here. Dbcc Question

  • I have a Error when using Dbcc

    CHECKDB found 0 allocation errors and 3 consistency errors in database 'Testdb'.

    repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (pmasys ).

    DBCC execution completed. If DBCC printed error messages, contact your system administrator.

    Now for the life of i can't figure out how to repair it.

    I have never scripted anything in my life.

    So would someoen be kind enough to Post a cut and paste of the right kind of Repair script?

  • I'm not sure I'm understanding you correctly, but if I am.... There's no script involved. You would simply issue the statement:

    DBCC CHECKDB [database name] REPAIR_ALLOW_DATA_LOSS

    After you do, run your DBCC CHECKDB again to see if it fixed the problem. You may have to run more than one repair for all of the problems to go away.

    Make sure that you take a full backup of your database before attempting repair. This is a destructive action, and you'll want to check your data after the repair.

  • On a side note... One thing you may want to do is make sure you have some type of index rebuild or defrag scheduled as regular maint on the db. Most of the time when I see consistancy errors on a checkdb but the db is up and doesn't seem to have any data problems the consistancy error is in an index and not in the table space or the clustered index. What seems to happen is the level of fragmentation prevents a write to the index properly or causes some allocation errors.

    Just an observation.

    Wes

    Wes

  • The DBCC CHECKDB Returns In its Output

    The Object ID and The Index ID Where The Problem Is

    Using Information Schema OR System Tables You Can Find The Object (Table and Index)

    Then You can Drop The Index And Recreate IT

Viewing 4 posts - 1 through 3 (of 3 total)

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