Tuesday 10 January 2012

SharePoint content database is in suspect mode in SSMS

Sometimes SharePoint site may get internet explorer error.

In my environment i am using SQL Server 2008 R2, SharePoint 2010, Win 7

I have found the error in MSSQL SERVER. Because my SharePoint site application content database is MSSQL Server not with SharePoint. I checked in Sql server here my data base is in suspect mode, So thats why this SQL server not allowing to perform any operations on that database. See here


Database can go in suspect mode for imporper shutdowns of sql server and ....etc. reasons,

To get the exact reason of a database going into suspect mode can be found using the following query.
Run this query:

"DBCC CHECKDB (’YourDBname’) WITH NO_INFOMSGS, ALL_ERRORMSGS"

Output of the above query will give the errors in the database.

To repair the database, run the following queries in Query Analyzer,

EXEC sp_resetstatus ‘yourdbname’;
ALTER DATABASE yourdbname SET EMERGENCY
DBCC checkdb(’yourdbname’)
ALTER DATABASE yourdbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (’yourdbname’, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE yourdbname SET MULTI_USER

I have found this solution from this blog

SharePoint Error message Full descriptive

SharePoint developers and Administrators sometimes will may get the error message as "An unexpected error has occurred"

By default SharePoint 2010 did not return a descriptive error message.
For displaying error message description you need to turn on Error Message.

Here are the steps for turning on the error messages instead of "An unexpected error has occurred"
  1. Open IIS--> and right click on the site and select explorer.
  2. Find web.config filen right click on it and select open with notepad.
  3. Find this line "<SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">"
  4. Change both "CallStack" and "AllowPageLevelTrace" from false to true.
  5. Find the line "<customErrors mode="On" />" and change the mode from On to Off.
Now you will be able to see the error message with complete details.
You can get the error message description from Errors Event ID in Even Viewer.
And you can get all the information about error message in URL Logs in C:\...14\LOGS folder.