Tuesday, August 14, 2012

How To Fix SharePoint Central Administration Content Database in Suspect Mode

What will be your first reaction when your Central Administration in SharePoint 2010 stops abruptly and its Content/Config database switches itself automatically to Suspect mode for no apparent reason, that too after a very stressful and super-hard working day.

Common human reaction is to get scarred, pissed-off, drop the F-bombs on SharePoint 2010, drink lots of coffee, get irritated and shout on friends and family... :)

I checked the ULS logs, Event Viewer logs, tried Application Pool recycles, Website Start/Stops, IIS Resets, even re-booted the server, even ran the SP 2010 Config Wizard. Sadly, none of them worked. By now I started thinking that my SP 2010 farm is corrupt and needs to be re-configured/re-installed from scratch. A very painful thought in itself.

But as I further researched on this weird content database suspect issue, found this post on the forum which got me started: http://social.msdn.microsoft.com/forums/en-US/sqldisasterrecovery/thread/48cf82c9-2179-46f3-b009-11416a90d248/

However, I had to do a lot of R&D to get the actual SQL commands working.

Go to your SQL Server and ensure either your Central Admin Content Database or Config Database, if it is in Suspect mode, then this post is for you, see snapshot below:



So either a Central Admin Content database or a Config database can abruptly go into the suspect mode without any apparent logical reason. In my case, SharePoint Central Admin Content Database went into the Suspect mode.

To resolve the issue, follow steps in the following order as mentioned:

1. Go to your MSSQL\Data files that reside under: C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA



2. Identify your Central Admin Content Database name in my case it got screwed up and was in the suspect: mode: so this is my content database name SharePoint_AdminContent_38c5cc2d-aeec-4dc2-b7a5-65457250ae2c


NOTE: Please take a backup of the corrupted .mdf and .ldf files, before following other steps.

3. Open your SQL Server Management Studio ->, New Query and it opens up your SQL Query editor, copy and paste the query below and change the highlighted to your database name:

Use master

--Verify whether Database has any issues
EXEC sp_resetstatus "SharePoint_AdminContent_38c5cc2d-aeec-4dc2-b7a5-65457250ae2c.mdf"

---Alter database and put it on Emergency Mode
ALTER DATABASE "SharePoint_AdminContent_38c5cc2d-aeec-4dc2-b7a5-65457250ae2c" SET EMERGENCY
DBCC checkdb('SharePoint_AdminContent_38c5cc2d-aeec-4dc2-b7a5-65457250ae2c')

--Set the database in the Single User mode
ALTER DATABASE "SharePoint_AdminContent_38c5cc2d-aeec-4dc2-b7a5-65457250ae2c" SET SINGLE_USER WITH ROLLBACK IMMEDIATE

--Repair the database and allow data loss
DBCC CheckDB('SharePoint_AdminContent_38c5cc2d-aeec-4dc2-b7a5-65457250ae2c',REPAIR_ALLOW_DATA_LOSS)

--Set the database back to Multi-User mode
ALTER DATABASE "SharePoint_AdminContent_38c5cc2d-aeec-4dc2-b7a5-65457250ae2c" SET MULTI_USER

--Ensure Database is reset
EXEC sp_resetstatus 'SharePoint_AdminContent_38c5cc2d-aeec-4dc2-b7a5-65457250ae2c'

Execute all the commands in your SQL Query Editor and there you go, Go back to your SQL Management Studio and you can see that the (Suspect) mode issue against the Content/Config database is fixed and the database got fully repaired and restored.

To verify the same, hit your Central Administration and it starts working just fine...

NOTE: This post is true for any Content Database/Config Database in your SharePoint 2010 farm and not subject to only the Central administration web application. It will work equally well, if any of your current Web Application/Site Collection Content database gets corrupted and switches into the Suspect mode.

10 comments:

  1. If your SharePoint database got corrupted or it automatically switch to Suspect mode then you can also use one another solution that is SharePoint Server Recovery Software. I recovered my database with 'Stellar Phoenix'.

    ReplyDelete
  2. one of our application's content database id in 'Not Responding' status, does the above steps works for this case also>?

    ReplyDelete
  3. Worked for me thank you :-)

    For a standalone installation, the .mdf files are at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Data\MSSQL10.SHAREPOINT\MSSQL\DATA

    I couldn't EXEC sp_resetstatus (permissions) but the rest was good

    ReplyDelete
  4. Few days ago, I have faced similar problem of SharePoint database, but I have recovered my all database with Kernel for SharePoint Server Recovery tool within short time interval. To know more info, click here: http://www.repairsharepoint.com

    ReplyDelete
  5. Effective tool one you can very readily repair their corrupt or damaged SharePoint Server all MDF database and recover its objects with Raw and Live SQL Instance mode. Get info, visit :- http://www.recoverydeletedfiles.com/sharepoint-server-data-recovery.html


    ReplyDelete
  6. Get Sharepoint database repair Software can easily repair your all type of corruption issues from your SharePoint database due to accidental file deletion on WSS websites, drive failures, server downtime, drive failures and any other. I would like to suggest you to use this user-friendly tool:- http://www.filesrecoverytool.com/sharepoint-database-repair.html

    ReplyDelete
  7. Get an easy way to recover your corrupt SharePoint database: http://www.sharepointrecoverytool.com/

    ReplyDelete
  8. Great stuff again. Thanks for making time to write these articles. You will be my number one resource, Looking forward to more articles
    SharePoint 2013 Training

    ReplyDelete
  9. SharePoint Server Recovery is expedient that repairs, recovers the lost, corrupt or inaccessible SharePoint databases. The software is very well embedded with two file repair modes - Raw mode and Live SQL Instance that enables its user extract files and folders from corrupt, damaged MDF database effortlessly .

    See full info :- http://www.mannatsoftware.com/stellar-phoenix-sharepoint-recovery.html

    ReplyDelete
  10. Very useful way you have share to all users, in reply I have share an another third party tool like SharePoint Database recovery tool to repair SharePoint database and recover all SQL and MDF files from your PC. The software provide you two scanning modes 1) Raw SQL Instance mode, 2) Live SQL Instance mode help you to recover database from SharePoint server.

    Visit: - http://www.softmagnat.com/sharepoint-recovery.html

    ReplyDelete