I ran DBCC CHECKDB on all of the companies databases as the beginning of a planed monthly maintenance I am putting into effect and I found several databases with consistancy errors. Now because most of these databases are stored offsite and are transfered in office only when we need to do some in house work on it, the only backup we have has those errors so I cannot restore from a backup. I tried using the REPAIR_ALLOW_DATA_LOSS option and that fixed 1 of the 4 databases with problems but did nothing for the other 3. Reading the MSDN I noticed that it works harder in emergency mode so I wrote and ran the following:
ALTER DATABASE [Charlestown] SET EMERGENCY, SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
DBCC CHECKDB ('Charlestown', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS
GO
ALTER DATABASE [EastGreenwich] SET EMERGENCY, SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
DBCC CHECKDB ('EastGreenwich', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS
GO
ALTER DATABASE [TrainingDB] SET EMERGENCY, SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
DBCC CHECKDB ('TrainingDB', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS
GO
This gives me the following output:
Msg 8992, Level 16, State 1, Line 2
Check Catalog Msg 3853, State 1: Attribute (object_id=766832133) of row (class=0,object_id=766832133,column_id=0,referenced_major_id=212208552,referenced_minor_id=7) in sys.sql_dependencies does not have a matching row (object_id=766832133) in sys.objects.
Msg 8992, Level 16, State 1, Line 2
Check Catalog Msg 3853, State 1: Attribute (referenced_major_id=2005594929,referenced_minor_id=67108867) of row (class=0,object_id=1035267589,column_id=0,referenced_major_id=2005594929,referenced_minor_id=67108867) in sys.sql_dependencies does not have a matching row (object_id=2005594929,column_id=67108867) in sys.columns.
CHECKDB found 0 allocation errors and 2 consistency errors not associated with any single object.
CHECKDB found 0 allocation errors and 2 consistency errors in database 'Charlestown'.
Msg 8992, Level 16, State 1, Line 2
Check Catalog Msg 3853, State 1: Attribute (object_id=766832133) of row (class=0,object_id=766832133,column_id=0,referenced_major_id=212208552,referenced_minor_id=7) in sys.sql_dependencies does not have a matching row (object_id=766832133) in sys.objects.
Msg 8992, Level 16, State 1, Line 2
Check Catalog Msg 3853, State 1: Attribute (referenced_major_id=2005594929,referenced_minor_id=67108867) of row (class=0,object_id=1035267589,column_id=0,referenced_major_id=2005594929,referenced_minor_id=67108867) in sys.sql_dependencies does not have a matching row (object_id=2005594929,column_id=67108867) in sys.columns.
CHECKDB found 0 allocation errors and 2 consistency errors not associated with any single object.
CHECKDB found 0 allocation errors and 2 consistency errors in database 'EastGreenwich'.
Msg 8992, Level 16, State 1, Line 2
Check Catalog Msg 3853, State 1: Attribute (object_id=766832133) of row (class=0,object_id=766832133,column_id=0,referenced_major_id=212208552,referenced_minor_id=7) in sys.sql_dependencies does not have a matching row (object_id=766832133) in sys.objects.
Msg 8992, Level 16, State 1, Line 2
Check Catalog Msg 3853, State 1: Attribute (referenced_major_id=2005594929,referenced_minor_id=67108867) of row (class=0,object_id=1035267589,column_id=0,referenced_major_id=2005594929,referenced_minor_id=67108867) in sys.sql_dependencies does not have a matching row (object_id=2005594929,column_id=67108867) in sys.columns.
CHECKDB found 0 allocation errors and 2 consistency errors not associated with any single object.
CHECKDB found 0 allocation errors and 2 consistency errors in database 'TrainingDB'.
Now I am not sure what can be done to fix those errors. I am primarily a C++ programmer going for my PhD in Computer Science and specializing in Digital Forensics, but the company I work for needed someone to manage their databases so I am doing what I can. Any help would be appreciated and if you need any more information let me know.
Daniel Ducharme
Computer Systems Analyst