.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Configure Remote BLOB Storage (RBS) with the FILESTREAM provider in SharePoint 2010

Posted By:Sunil Yadav       Posted Date: October 28, 2010    Points: 75    Category: SharePoint    URL: http://www.dotnetspark.com  

This article explains how we can configure Remote Blob Storage with FILESTREAM provider in Sharepoint 2010.
 


By default sql server stores all the structured and unstructured (blobs) data in the Database. Storing unstructured in the database increases the database size and affects performance. The unstructured data is often stored outside the database. SharePoint Server 2010 supports the FILESTREAM provider included in the SQL Server 2008 R2 which helps in storing the all_docs table and customized pages in a location outside the database such as file system.
Read more : Overview of Remote BLOB Storage

Enable FILESTREAM on Sql Server

1. Go to All Programs --> Microsoft SQL Server 2008 R2 -->Configuration Tools -->Select SQL   Server Configuration Manager

2. Click on Sql Server Services and from the list of services, select a Sql instance on which FileStream is to be enabled.

3. To enable FileStream, right click on a instance and select properties. Click on FileStream tab from the opened dialog box and select the properties you want to enable.

The whole process is shown in the below figure.



Reference: http://msdn.microsoft.com/en-us/library/cc645923.aspx


Provision a BLOB Store

Create a Master Key

IF NOT EXISTS

(

SELECT * FROM sys.symmetric_keys WHERE name = N'##MS_DatabaseMasterKey##'

)

CREATE MASTER KEY ENCRYPTION BY PASSWORD = '$PA$$ssw0rd12!$#4E2!1'
Note: There can only be one encryption key for the database.

Create a file group

IF NOT EXISTS

(

SELECT groupname FROM sysfilegroups WHERE groupname=N'RBSFilestreamProvider'

)

ALTER DATABASE[WSS_Content_3405eeac-d46f-4b92-9dbc-a70f4cc6ff54]

ADD filegroup RBSFilestreamProvider CONTAINS FILESTREAM

Add a FileStream File to File Group

ALTER DATABASE [WSS_Content_3405eeac-d46f-4b92-9dbc-a70f4cc6ff54]

ADD FILE (name = RBSFilestreamFile, FILENAME= 'E:\Blobstore') TO filegroup RBSFilestreamProvider
The default files created at E:\Blobstore is filestream.hdr and a folder name $FSLOG. filestream.hdr file contains the FileStream header information.

Install RBS

Install RBS on the database server and on the required Web servers and application servers in the SharePoint farm. RBS must beconfigured separately for each associated content database.

Download the installer from the below URL. http://go.microsoft.com/fwlink/?LinkID=188395&clcid=0x409 (x64)

Once done with successful installation, open command prompt and execute the following command.
msiexec /qn /lvx* rbs_install_log.txt /i RBS_X64.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY

DBNAME="WSS_Content_3405eeac-d46f-4b92-9dbc-a70f4cc6ff54" DBINSTANCE="MOSSPORTAL\Sharepoint"

FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1
Open rbs_install_log.txt and look for text "Product: SQL Server 2008 R2 Remote Blob Store -- Installation completed successfully." to verify whether the RBS is installed successfully or not. Consider the below image.


Enable RBS on SharePoint 2010

Open SharePoint 2010 Management Shell and execute the below commands.
$db = Get-SPContentDatabase -WebApplication http://mossportal:2010/

$rbs = $db.RemoteBlobStorageSettings

$rbs.Installed()

$rbs.Enable()

$rbs.SetActiveProviderName($rbs.GetProviderNames()[0])

$rbs


Additional folder created with new Guid.



Navigate to the site and upload documents.



The document uploaded gets stored in E:\blobstore\Guid folder in a file stream format.

Here you can create a copy the file and change its file type to docx or whatever format it is to verify the file content.



Happy SharePointing!!!!!

References:

http://technet.microsoft.com/en-us/library/ee748638.aspx
http://technet.microsoft.com/en-us/library/ee748631.aspx
http://msdn.microsoft.com/en-us/library/cc949109.aspx

 Subscribe to Articles

     

Further Readings:

Responses
Author: Swaroop R         Company URL: http://www.dotnetspark.com
Posted Date: November 22, 2010

Hi Sunil,

I tried the Filestream on MOSS 2007 and modifying the necessary DB tables.

Below are observations.

1. If a document is uploaded twice two copies of the document exist separately on the drive. Ideally if same document is uploaded with overwrite option, only one copy should exist also deleting the file did not remove from the drive.

2. Am not sure how versioning will be taken care internally if Versioning is enabled on a document library.

3. Our objective was to store huge files on fileservers. But FileStream only supports files that are stored locally on the drive.

4. A custom plugin or component if integrated, where the files/documents have to be moved or archived using OM, not sure this can be managed with the above feature.

Thanks,
Swaroop

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend