DBCC commands

  • What is the main purpose of DBCC CHECKDB and DBCC CHECKALLOC

    ...in simple terms pls..thanks

  • It checks the integrity of your database to ensure you have no corruption present.

    CheckDB includes all the checks done by checkAlloc, so it's not necessary to run both.

    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
  • thanks for the quick reply

  • Adding to it: It shouldnt be RUN Frequently, I would recommend once a Week.

  • Hi,

    CheckDB is the superset of checkAlloc, so if you are running CheckDB, its not necessary to run checkAlloc.

    thanks


    nkgupta

  • Running it frequently..does it mean that we need to run these commands say very week on all the databases? doesnt it affect the overhead performance? if we need to run..then what time is advisable?..and can any one pls suggest some examples too..thanks..

  • They are extremely resource intensive. You should not run them when you have users accessin the DB. If you have downtime over a weekend, run the checkdb then

    You should (imho) run them once a week or once a fortnight. If you get corruption in the DB, it's very, very important to find it quickly and know when the database was corruption free for the purposes of selecting a recovery strategy.

    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
  • thank you! can you please provide me with some examples , as to how the results would look, if any error in the database was spotted...after running these DBCC commands? and what would be the next steps.? thanks

  • DBCC will generate a report for you whether having issue or not.

  • There are examples of how to use it in Books Online.

    CheckDB generates a lot of info messages as it runs. If it finds any errors it will tell you. As for what you do if it finds one, well, that depends on what kind of error it finds.

    If you want a lot of reading on fixing the kind of problems that CheckDB finds, read through Paul's blog[/url]

    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
  • Thanks alot!

  • I am trying to understand the need to run DBCC checkDB. We have set up maintenance plan to reindex and check the integrity of DB weekly. Every thing works fine.

    Do we still need to run DBCC check DB weekly? What could we find if we run our maintenance plan regularly

  • The maint plan that checks ingegrity runs checkDB. There's no need for a manual job if the maint plan's doing it

    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

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

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