DBCC CHECKDB - how use it in a maintenance plan ?

  • I know this is an old thread, but a question.

    If you have a SQL job running DBCC checks, and a check finds an error, does it raise an error so the job reports failure, or do you need to parse through the logs it generates each time it runs and look for errors manually?

    The Redneck DBA

  • Please rather post new questions in a new thread. Thanks

    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
  • Hi, (Caveat - I am only a very part time self taught SQL Admin and have been relying on things read recently.)

    If the Maintenance tasks are linked within the one maintenance plan and you start with the verify then the back up will not proceed unless the dbcc checkdb suceeds. What I haven't yet determined is what the DBCC check task classes as a success - presumably no errors.

    But you may still want the backup to proceed even if there are errors - but what you definitely do not want is the old backups to be removed as they may be needed if your database is indeed nastily corrupted?

    So it seems that doing the backup first, then the checkdb, then the cleanup of old .bak files then trn files is a good option. The backup still happens but the checkdb will, if it fails, prevent the bak and trn files that you might need from being removed. Obviously space could become an issue if it is left unresolved for a period. Also this relies on no other maintenance plan deleting the .bak or .trn files.

    Does this sounds sensible to those with lots of experience?

  • Hi, woops - thought the other reply disappeared.

Viewing 4 posts - 31 through 33 (of 33 total)

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