I ran Brent Ozar's script sp_Blitz, and one item it returned was this:
Last good DBCC CHECKDB over 2 weeks old tempdb
Database [tempdb] never had a successful DBCC CHECKDB. This check should be run regularly to catch any database corruption as soon as possible. Note: you can restore a backup of a busy production database to a test server and run DBCC CHECKDB against that to minimize impact. If you do that, you can ignore this warning.
For this SQL Server (a staging server) I use Ola Hallengren's SQL Server Maintenance Solution, with this setup for checking database integrity:
sqlcmd -E -S $(ESCAPE_SQUOTE(SRVR)) -d utility -Q "EXECUTE [dbo].[DatabaseIntegrityCheck] @databases = 'SYSTEM_DATABASES', @LogToTable = 'Y'" -b
I now realize I may need to give a fuller set of parameters to the sp, but even so, I have set the @databases value to 'SYSTEM_DATABASES'. When I check the corresponding function in the tool that is supposed to retrieve the databases to check, I see this:
IF @CurrentDatabaseName = 'SYSTEM_DATABASES'
INSERT INTO @Database03 (DatabaseName, DatabaseStatus)
SELECT [name], @CurrentDatabaseStatus
WHERE [name] IN('master','model','msdb','tempdb')
I see tempdb listed there, but not in the log file for the job when it's run. In the log file, master, model, and msdb are being checked. But not tempdb.
Does anyone know if this is (1) a bug in Ola's scripts, or (2) just that CHECKDB doesn't run against tempdb? Or (3) just that I misconfigured it?
Ola's scripts are really excellent, so I think the issue is (2) or (3), but at this point I can't be sure.
Thanks in advance for any help. I'm hoping someone here knows the answer, but if I should just contact Ola, let me know.