SharePointsBlog

Interesting Exploits in Office 365 and SharePoint

SharePoint_Config Database Suspect Mode – Cannot Connect to the Configuration Database Error

If SQL Server ever crashes or hard booted, you may come across a possible corrupted SharePoint_Config database. Recently while doing SharePoint 2010 configuration of our new product suite on my VM, I had to hard reboot the VM. When the VM came back up, I received the dreaded “cannot connect to the configuration database error”.  This occurs while accessing any of the content web application.

cannot-connect-to-config-db-error

I’ve seen this condition before, so I tried the usual debugging avenue – – IIS Web Site availability, IIS Application Pool Availability. IIS Application Pool Identity, and SQL Server availability. (see http://support.microsoft.com/kb/823287)  After walking through these steps, I noticed that “SharePoint_Config” database was in suspect mode. (notice the order of the items in my debugging avenue…yes, SQLServer was last)

sharepoint_config_suspect1

A quick BING took me following links to fix this issue.

http://ahmershahid.wordpress.com/2009/05/25/moss-2007-config-db-in-suspect-mode/
http://www.aarat.com/sharepoint-config-database-suspect/

As it turned out, it’s not a SharePoint issue. Any SQL Server databases can be corrupted and gets in the suspect mode. The following steps will fix the suspect database mode issues. As usual, I don’t take credit for this solution, but only post as a reference.  The credit goes to above blogs.

— Use the Master database
Use Master
— Verify that database has issues
EXEC sp_resetstatus ‘SharePoint_Config’
— Put the database in emergency mode
ALTER DATABASE SharePoint_Config SET EMERGENCY
DBCC checkdb(‘SharePoint_Config’)
— Set the database in single user mode
ALTER DATABASE SharePoint_Config SET SINGLE_USER WITH ROLLBACK IMMEDIATE
–Repair the database with data loss
DBCC CheckDB (‘SharePoint_Config’, REPAIR_ALLOW_DATA_LOSS)
–Set the database in multi-user mode
ALTER DATABASE SharePoint_Config SET MULTI_USER
–Verify that database is reset
EXEC sp_resetstatus ‘SharePoint_Config’

To fix SQL Server database suspect mode, we need to use the SQL Server’s emergency mode which allows you repair the database by reparing to last normal state.

After running the script on the Master database, SharePoint_Config database suspect mode was fixed and I was able to access the content web application.

sharepoint_config_suspect_r

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: