Oct 15, 2014

Recovering SharePoint database from the Suspect Mode

Hi Guys,
In this post I am explaining how we recover a sharepoint content database from “suspect” mode.  . This is not a sharepoint specific issue, it’s the issue with the sql  server db. 
Possible reasons to go in to Suspect Mode
  • Corruptions in the log/datafiles,
  • Hardware failure,
  • Antivirus programs ,  
  • Low disk space on the server or
  • Sudden shutdown of server while executing the transactions which were not rollback by server .etc.

Generally the db will be appear like this in suspect mode

Steps to Recover
Run the below commands in db 
EXEC sp_resetstatus 'SharePoint_Config' 
This command removes the suspect flag on the database 
Then set the db to Emergency mode, so that the db becomes read only and accessible to only privileged users like sysadmins 
Check the database for any inconsistency by running this following query 
DBCC CHECKDB ('SharePoint_Config') 
Then bring the database in to Single User mode by roll backing any transactions are present in the database 
Now take the backup of the database, since the next commands which we are going to execute are “One Way”  , there is no way to get the state back after execution. So for safety take a backup.
Now bring back the database to Multi User Mode
Refresh the db, now you should be able to see the db in usual mode . Now the users should be able to access the sharepoint site.
If you find any data loss, you can restore the database from the backup which we took in the above step.
You can cross check all the commands here

Hope this is helpful..!!



Oct 9, 2014

Content Search WebPart as a Rotating Banner in SharePoint 2013

Hi Guys,

Content Search Web part is a new web part introduced with SharePoint 2013 in Content Rollup Category. This is mainly used to apply different styling to the dynamic generated content. Here in this post I am going to show you how we can utilize this web part as a Rotating Banner (Picture Carousel). I have taken SharePoint Picture Library is the data source for the Banner.

Create aPicture Library and Upload Some Images

Picture Library Name: LandingPageImages

Upload few Images

Add Content Search Web part on a Page from Content Rollup Category

By default it shows some content. Now we need to map our picture library data source to this webpart by changing the query.

Edit the webpart like below

Click on “Change Query” button in the properties tool pane

And Set these values in the Build Your Query Window

Select a Query: Pictures
This is the data source from where we the web part pulls the content

Restrict By app: Specify a URL and give the url of the landing pages image library (eg :http://mysitename/LandingPageImages)
This is to give the scope  to the result set

Restrict By tag : Don’t Restrict by any tag
This means we are not restricting any content from display

And then Click Ok.  In the Edit Panel Say Apply.

If you see below error that means your newly created picture library is not crawled by search engine.

So go and do the incremental crawl.

Steps: Go to Central Administration àManage Service Applicationsà Search Service Applicationà Manage (in the ribbon)—> Content Sources (From left pane) à Select Local SharePoint Sites (If you are not having particular content source already) àSay Start Incremental Call.

Wait until the crawling has completed.  (Wait until the status becomes Idle for the content source).

Now go back to page and see, Our webpart showing the images in this way.

Now change the properties in the edit pane to show the images in a slider mode.

Set the properties like below No of Items to: 5, Control : Slideshow, Item : Large picture

Now you can see, our content search webpart working as the Image slider..!!!