Error 8921 running DBCC CHECKDB

Jeevan Gharti picture Jeevan Gharti · May 30, 2016 · Viewed 7.4k times · Source

DBCC CHECKDB shows following error message in my sql server 2008 R2 database

Msg 8921, Level 16, State 1, Line 2 Check terminated. A failure was detected while collecting facts. Possibly tempdb out of space or a system table is inconsistent. Check previous errors.

What is the solution?

Answer

Paul Randal picture Paul Randal · May 30, 2016

Given that DBCC CHECKALLOC fails too, with no corruption messages, your database has corrupt metadata and you need to restore from your backups (the first thing it does is run some basic checks on the three critical system tables it needs, and if they're badly broken, it will fail with message 8921). You have no other choice here - you can't run repair as you can't get DBCC CHECKDB to run.

It's possible you could narrow down which system table is corrupt using DBCC CHECKTABLE on successive object IDs from sys.objects, and then manually edit around the corruption, but that's very advanced and has a very low chance of success.

If you don't have any backups, you're going to have to create a new database and then export all the schemas and data into the new database.