Start a new topic

Rotation and time constraints

Backstory:

2 servers, each with 900+ databases ranging from about 10GB to a few TB.

Not much traffic at night due to the nature of our business (heavies usage would be between 7 AM East coast time, to about 7 PM West coast.  No idea if we have users in Hawaii, Alaska or territories, if we do not many).


1 server with fewer databases, but one that is 7 TB.  Regular CHECKDB gets through everything but this one database.


My main concern right now is the 2 servers with tons of databases.


Here is what I am thinking, with fine tuning as I see it in action:

Dynamic thresholds around 100 GB (default) for switching to TABLECHECK.  This should allow most of the smaller client databases to run CHECKDB.


Rotational Scheduling, where it run 3 hours (1 AM to 4 AM) per day during weekdays, 8 hours (1 AM to 9 AM) during the weekend.  Weekend some time would be interrupted earlier if there is patching on the server, being able for it to restart if it does would be optimal.


This is what I have done on my own test server to test it, hopefully not too far off.

 

update Minion.CheckDBSettingsRotation 
	set IsActive = 1, -- activate Rotation
	RotationMetricValue = 180
where RotationLimiter = 'Time'

  

update Minion.CheckDBSettingsServer
	set IsActive = 0
where OpName = 'CHECKDB' 
	and DBType = 'User'

 

 

update Minion.CheckDBSettingsServer
	set IsActive = 1, -- to activate
	BeginTime = '01:00:00', 
	EndTime = '04:00:00',
	Day = 'Weekday' -- was saturday
where OpName = 'AUTO' and ID = 3

 

  

insert into Minion.CheckDBSettingsServer (
	DBType, 
	OpName, 
	Day, 
	ReadOnly, 
	BeginTime, 
	EndTime, 
	MaxForTimeframe, 
	CurrentNumOps, 
	NumConcurrentOps, 
	DBInternalThreads, 
	Debug, 
	FailJobOnError, 
	FailJobOnWarning, 
	IsActive)
select
	DBType, 
	OpName, 
	'Weekend', 
	ReadOnly, 
	'01:00:00', 
	'09:00:00', 
	MaxForTimeframe, 
	CurrentNumOps, 
	NumConcurrentOps, 
	DBInternalThreads, 
	Debug, 
	FailJobOnError, 
	FailJobOnWarning, 
	IsActive
from Minion.CheckDBSettingsServer S
where 
	S.OpName = 'auto' -- yeah redundant
	and S.ID = 3 

 

 So I set the Rotation for only Time to be IsActive = 1.


Leave the System CHECKDB active from 22:00 to 22:30.


AUTO active for the User databases, two records, one for Weekday and one for Weekend.


On these 2 servers, I THINK I could increase NumConcurrentOps and DBInternalThreads, only backups should really be running at that time of night, with maybe a few occasional users working way too late.

Comments and suggestions welcome.  First time I am implementing one of your solutions.



Nice, however I'd put those comments both in the SP itself, and in the comment col of the SettingsServer table. And if you need it to do anything else just add it to that SP. Let me know if it does what you expected.

Added a proc called Minion.SetActiveRotation 

 

update Minion.CheckDBSettingsServer 
set BatchPreCode = 'exec Minion.SetActiveRotation' -- called with defaults.  Can be used to also update the time limit
where IsActive = 1

 




Yupp!  Makes perfect sense.


Login or Signup to post a comment