Home Forums SQL Server 2005 Administering DBCC CHECKDB - how use it in a maintenance plan ? RE: DBCC CHECKDB - how use it in a maintenance plan ?

  • Leo (10/16/2008)


    1. How do we know database is corrupt before the Backup at 22:00? Job is already setup and backup the corrupt database anyway according from the JOB. Any way to stop that, NOT to backup?

    You could write the results of checkDB to a table and have the backup job check that.

    2. Which command can fix and repair the Database if 'dbcc checkdb' result is failed.

    Don't repair. If all the corruption is within nonclustered indexes, you rebuild (or drop and recreate) those indexes.

    If the corruption is elsewhere, you restore the last clean backup and then roll the transaction log backups forward.

    Repair is a last-resort when there's no good backup and no other way to get data back. It doesn't always work.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass