SharePoint 2010 File Storage System

SharePoint provide us a nice UI to store and read documents. But what happen behind the scene. Where it store all the files???

File System or Content Database

When we open document library in windows explorer view, SharePoint allow us to delete/update/add files as we do in the normal file system. So, what does it mean that files are stored in a physical location.

Nope. Not with SharePoint. It keep all the documents in a database. Ooooh database!!!

Doesn’t sound good to keep the documents in a database. What if my file size is big. Will it not slow down the performance as SQL BLOB operation are costly than accessing file from a physical path. Even SQL Express editions has limitation on database size (approx 10GB i think). Do to SQL storage, SharePoint allow file upload of max 2GB.

Cons with Content Database

– Costly SQL operations

– Limitation on file size

– Huge database size due to big files

Pros with Content Database

– Easy backup/restore process. As all data in one single file

With release of SharePoint, we have the option to configure storage of SQL Binary Large OBjects (BLOB) to physical file system. In SQL Server 2008 (including express ūüôā ), Microsoft provided an add-on feature pack called Remote Blob Storage (RBS) used for storage of BLOB to physical location.

Lets start how we can enjoy RBS feature with SharePoint 2010. Below post will explain how to configure RBS for SharePoint 2010.

Step 1. Select the Content database for RBS. (It is possible to limit the RBS per Web Application level)

a. Open Central Administration Site -> Application Management -> Manage Content Databases

b. Select Web Application for which you want to enable RBS. Note down the content database name for selected Web Application.

Step 2. Enable file stream on SQL Server 2008/R2 (including express edition)

a. Open SQL Server Configuration Manager -> SQL Server Services

b. Right click SQL instance on which SharePoint is running, and then select properties.

c. Select FILESTREAM tab -> checkbox Enable FILESTREAM for Transact-SQL access.

d. Select other checkboxes as per your requirement and click Apply -> Ok.

e. Open SQL Server Management Studio. Execute following query for Web Application Database as selected in step 1.

EXEC sp_configure filestream_access_level, 2
RECONFIGURE

Step 3. Provision a BLOB store

a. Open SQL SERVER Management Studio. Execute below queries for Web Application Database as selected in step 1. Note: Replace WSS_Content as per step 1.

use [WSS_Content]
if not exists 
(select * from sys.symmetric_keys 
where name = N'##MS_DatabaseMasterKey##')
create master key encryption by password = N'Admin Key Password !2#4'
use [WSS_Content]
if not exists 
(select groupname from sysfilegroups 
where groupname=N'RBSFilestreamProvider')
alter database [WSS_Content]
add filegroup RBSFilestreamProvider contains filestream
use [WSS_Content] 
alter database [WSS_Content]
 add file (name = RBSFilestreamFile, filename = 
'c:\Blobstore') 
to filegroup RBSFilestreamProvider

Step 4. Install RBS.

a. Download installation package using links: X64 Package X86 Package IA64 Package

b. Install RBS client library on the web server. Note: Replace WSS_Content as per step 1 and DBInstanceName as per your SharePoint environment. Locate cmd prompt to download folder and execute following command.

msiexec /qn /lvx* rbs_install_log.txt /i RBS-x64.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="WSS_Content" DBINSTANCE="DBInstanceName" FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1

Step 5. Enable RBS

a. Open SharePoint 2010 Management Shell and execute following commands. Note: Replace WSS_Content as per step 1.

$cdb = Get-SPContentDatabase <ContentDatabaseName>
$rbss = $cdb.RemoteBlobStorageSettings
$rbss.Installed()
$rbss.Enable()
$rbss.SetActiveProviderName($rbss.GetProviderNames()[0])
$rbss

Step 6. Test RBS Installation
a. Browse to RBS directory store and confirm folder is empty.
b. Upload a file to SharePoint Web Application (of atleast size 100 Kb).
c. Browse to the file in the RBS directory store and open the file with the most recent modified date. This should be the file you have uploaded.

Cheers !!!

Advertisements

About Rajan
I am Rajan Garg working as a Senior Software Engineer in a company. I am working on the Microsoft technologies.

2 Responses to SharePoint 2010 File Storage System

  1. VSK Ayyappa says:

    Dear Sir,

    I was followed steps but in 3rd step some command use in query it will show some error please resolve this issue

    Configuration option ‘filestream access level’ changed from 2 to 2. Run the RECONFIGURE statement to install.
    Msg 5520, Level 16, State 2, Line 15
    FILESTREAM file ‘RBSFilestreamFile’ cannot be added because its destination filegroup cannot have more than one file.

  2. Myrtis says:

    Hello to all, it’s genuinely a good for me to pay a visit this site, it includes priceless Information.

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: