Start a new topic

CheckDB rotation issues

I've been running CheckDB for  a few days now. All DBs have now been cycled through. I did originally set the default rotation at 7 days, however I changed this to 3 this morning to make sure that the checks started again,


Unfortunately after changing the default to three the default jobs are starting and ending successfully without starting any checks. The checkDBSettingsServer table shows the CurrentNumOps at 2 but there are no threads currently running.


Is there anything else I need to do or could check?


Ok, I remember you saying something about using the days rotation before, and I didn't focus on it.  I'm almost 100% positive that the days rotation hasn't been implemented yet.  What that's gonna be for is say you've got 3000 DBs on a server and you want them to all be done every week.  It will look at how many it would have to do each day and divide them up.  However, the only rotations that are currently implemented are number of DBs and time.  So you can say you want to do 10 DBs at a time, or you can say do as many as you can in 2hrs.  


Honestly I'm kinda surprised that it did any of your DBs at all.  Being on a rotation that doesn't exist I don't know what'll happen.  Maybe it grabs the first one it finds.  I'll dig into it if I get time.

Thanks Sean. I changed the RotationPeriodInDays back to NULL on CheckDBSettingsRotation for the active schedule. however the checks haven't started running again unfortunately.

Tell you what... tell me exactly it is you'd like to do and I'll tell you how to do it.

Sorry if i'm being a pest, essentially I'm just trying to set all of the databases to do their CheckDBs on rotation. I'd misunderstood the rotation in days and thought that meant that once a DB or table was done it wouldn't be checked again until that time elapsed. However as you've explained that's not the case I set the RotationInDays back to null and have the defaults of  10 checkdbs and 100 checktables.


So I have that set, and say that the schedule is 9-10pm on weekdays and 12-10pm on weekends, with the auto job scheduled to run every 30 minutes during that time and  maxfortimeframe set to a high number so that it can keep on with the rotation of 10/100 during the defined window.


what I'm trying do get it to do is once the auto job has done all of the checks,starting with database A and finishing at database Z, the next time it runs it would simply start the cycle again back at database A. 



No it's not being a pest at all.  This is what the forums are for.


Yeah, so what you want is to setup your rotation like this.

You want to enable the DBCount row.  It should be the first for in the SettingsRotation table.  That's the only row that can be enabled for CHECKDB ops.

And here's what should happen.  Say you've got 103 DBs.  It'll do 10 of those every time it runs.  So if you run multiple times a day it doesn't care.  As long as it's a new run it'll pick up where it left off.

But what about that last one?  With 103 DBs you'll have 3 left at the end and you won't be running 10 DBs.  You actually will.  What's supposed to happen in that case is it takes those 3, and then adds back in the other 7 from the beginning.  So it will always be doing 10.


But I can't stress this enough.  You can only have 1 rotation for each op active at a time.  If you have 2 CHECKDB rotations active, you won't get what you want and it might fail.  I'm not sure.  

And you can have multiple CHECKTABLE rotations active, but they have to be for different DBs.  So you can only have 1 active rotation per DB for CHECKTABLE.


I hope it makes sense that you can't do that for CHECKDB.  The fact that you're rotating all the DBs means that each DB can't have a separate CHECKDB rotation.  That just doesn't make sense.

Login or Signup to post a comment