First run DBCC checkdb and then rebuild index?

  • Saturday DBCC Checkdb job schedule to run.

    Sunday Rebuild index schedule to run

    Is it perfect?

    or run first index reubuild and then checkdb?

  • You may want to consider running DBCC CheckDB more often. It really depends on how far back you keep backups. You always want to have at least one backup (if not more) on which DBCC CheckDB has been successfully ran. We had a situation where we were running DBCC CheckDB once a week, but only keeping 4 days worth of backups. There were 3 days each week on which data corruption could occur, and it could infest every one of our backups before we even knew about it. You want to avoid that kind of situation. Also, you want to know about data corruption as soon as possible so that you're not forced to restore data a week old. Unless your database requires extremely high availability, I'd consider running CheckDB nightly. Even if your database requires 24/7 availability, I'd still look at running it as often as possible.

    Whether DBCC CheckDB or the index rebuild runs first isn't really that important. Personally I run it in that order as well. The DBCC CheckDB runs nightly at 10, index rebuilds on Saturdays at 11, and our backups run nightly at 12. It's generally a good idea to run the index rebuilds before the backup, so that the backup contains freshly rebuilt indexes.

    RedGate offers a great free e-book that covers the why, when and how of database maintenance tasks. It's a really good read. I highly recommend it, and it might clarify/answer some of the other questions you might have: http://www.red-gate.com/about/book_store/sql_server_maintenance_plans.htm

    --J

  • There is no such rule as to whether CHECKDB or REBUILD should run first. Based on your requirements, those jobs can run in any order.

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

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

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