When was DBCC CHECKDB last run?

I started a new role recently and wondered if DBCC CHECKDB was run on a regular basis? Thankfully, it runs weekly and I found out by using DBCC PAGE.

DBCC TRACEON(3604)
GO
DBCC PAGE (<dbname>, 1, 9, 3)
GO
DBCC TRACEOFF(3604)
GO

You need to search for dbi_dbccLastKnownGood and you’ll get the last successful run date.

I couldn’t check the maintenance plan itself due to not having the correct SQL Server tools installed on my desktop. This bit of code gave me the answer I needed though.

Leave a Reply