I was looking through my SQL Server error logs to confirm that CheckDB was being run as I had scheduled based on my previous post to run DBCC CheckDB on all databases. I wanted to confirm that there was no corruption, and that all of the databases had been checked, and not had been missed. Going through this I noticed the logging of all of my databases, but one extra database showed up, the mssqlsystemresource database.
Now the mssqlsystemresource database is an internal SQL Server database that is used by SQL Server, it also gets replaced by SQL Server when you do an upgrade of your SQL Server database. It is hidden so that people don’t have access to it, and it doesn’t show up when you run the undocumented sp_msforeachdb it doesn’t include the mssqlsystemresource database. Additionally the sys.databases view doesn’t include the mssqlsystemresource database.
SELECT QUOTENAME([name]) FROM sys.databases;
DBCC CheckDB (master) And The mssqlsystemresource Database
It turns out that when you run DBCC CheckDB against the master database that the mssqlsystemresource database is also checked at that time. You can see this in either the error log, or in the output from DBCC CheckDB(master) as shown below. Once DBCC is done checking the master database, it automatically check the mssqlsystemresource database next.
If you are curious what is in the mssqlsystemresource database, just page through the DBCC CheckDB output and you can see a list of all the objects.