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

In this article I am describing about how to install and configure Remote BLOB Storage (RBS) with the
FILESTREAM provider on a Microsoft SQL Server 2008 database server that supports a Microsoft
SharePoint Server 2010 system. RBS is typically recommended in the case where the content
databases are 4 gigabytes (GB) or larger.

SharePoint stores the files (or the blobs) in content database. The advantage of that approach is it
simplifies the backup and restores process. We can back up a site collection related data in one file.
The disadvantage is the database size can be enormous if Site contains large number of files. It
may a critical problem if you use SQL Server Express Edition which has a limitation in database file
size. RBS is a library API set that is incorporated as an add-on feature pack for Microsoft SQL Server
2008 and Microsoft SQL Server 2008 Express. RBS is designed to move the storage of binary large
objects (BLOBs) from database servers to commodity storage solutions. RBS ships with the RBS
FILESTREAM provider, which uses the RBS APIs to store BLOBs.

We can configure SharePoint to stores the blob in the file system, instead of in database by possible
by leveraging FILESTREAM feature of SQL Server 2008 and Remote BLOB Storage (RBS). With
SharePoint 2010, the Remote Blob Storage (RBS) functionality allows putting documents into the
database file system instead of the database itself. Each content database is located in a specific
section of the file system where all the documents are stored.

Enable File Stream in SQL Server

  1. Connect to SQL Server 
         Start -> All Programs -> Microsoft SQL Server 2008 ->Configuration Tools -> SQL Server
         Configurations Manager

  2. In the Services list, click "SQL Server Services"

  3. Choose your SQL instance (For me "SQL Server (SHAREPOINT)") and right click Properties.

  4. Switch to the FILESTREAM tab and check all the available checkboxes

  5. Click Apply -> OK 

         
                

  6. Now start SQL Server Management Studio

  7. Open a query windows and execute the below SQL Statement mater database is fine

         EXEC sp_configure filestream_access_level, 2

         RECONFIGURE
          

  8. Next we should have a web application and a content database created for the same.
    If you didn't created create a content data base for your web application. I have created
    a content data base with the name SP2010_Blob

  9. You can use Power shell to create a new content DB with the following command
         
         New-SPContentDatabase -name SP2010_Blob-WebApplication url 
          

  10. Now we have to enable our new content DB to be prepared to use FILE STREAM

  11. Start
         -> All Programs -> Microsoft SQL Server 2008 R2 ->SQL Server Management 
        Studio

  12. Right click on SP2010_Blob and select a query window and execute the below
    statement. Replace "C:\BlobFiles " by your storage-path 

         use [SP2010_Blob]   

         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 [SP2010_Blob]

         if not exists (select groupname from sysfilegroups where
         groupname=N'RBSFilestreamProvider')alter database [SP2010_Blob] add
         filegroup RBSFilestreamProvider contains filestream

         use [SP2010_Blob]

         alter database [SP2010_Blob] add file (name = RBSFilestreamFile, filename
         = 'c:\ BlobFiles) to filegroup RBSFilestreamProvider

Install RBS on Web Server
      

  1. You must install RBS on the database server and on all Web servers and application
    servers in the SharePoint farm. You must configure RBS separately for each
    associated content database.

  2. On any Web server, go to https://go.microsoft.com/fwlink/?LinkID=177388
    (https://go.microsoft.com/fwlink/?LinkID=177388) to download the RBS.msi file.

  3. Click Start and then type cmd in the text box. In the list of results,right-click cmd, and
    then click Run as administrator. Click OK.

  4. Copy and paste the following command at the command prompt:

  5. Make sure you are running this command in the downloaded RBS.msi folder

         msiexec /qn /lvx* rbs_install_log.txt /i RBS_X64.msi
         TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY
         DBNAME="<ContentDbName>"
         DBINSTANCE="<DBInstanceName>"
         FILESTREAMFILEGROUP=RBSFilestreamProvider
         FILESTREAMSTORENAME=FilestreamProvider_1
          

  6. Where:

         1. <ContentDbName> is the database name in my case SP2010_Blob.

         2. <DBInstanceName> is the SQL Server instance name in my case DB
         SERVERNAME\SHAREPOINT.Please note you should give full name like I given

         To install RBS on all additional Web and application servers

  7. Click Start and then type cmd in the text box. In the list of results, right-click cmd,
    and then click Run as administrator. Click OK.

  8. Copyand paste the following command at the command prompt: 

          msiexec /qn /lvx* rbs_install_log.txt /i
         RBS_X64.msi DBNAME="ContentDbName"
         DBINSTANCE="DBInstanceName"
         ADDLOCAL="Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer"
          

  9. You should repeat this procedure on all Web servers and application servers. If you do 
    not install RBS on every Web and application server, users will encounter errors when
    they try to write to the content databases.

  10. The rbs_install_log.txt log file is created in the same location as the RBS.msi file. Open
    the rbs_install_log.txt log file with a text editor and scroll toward the bottom of the file.
    Within the last 20 lines of the end of the file, an entry should read as follows:
    "Product: SQL Remote Blob Storage - Installation completed successfully".

  11. The script has created a some tables in the database, the following query help us to
    check that

        

         
         
         use SP2010_Blob

         select * from dbo.sysobjects

         where name like 'rbs%' 

To enable RBS
      

  1. On the Start menu, click Programs, click Microsoft SharePoint 2010 Products, and then
    click SharePoint 2010 Management Shell.

  2. At the Windows PowerShell command prompt, type each of the following commands. 

         $cdb = Get-SPContentDatabase -WebApplication Your
         URL

         $rbss = $cdb.RemoteBlobStorageSettings

         $rbss.Installed()

         $rbss.Enable()

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

         $rbss

          

  3. We almost did with the configuration. Create a site collection and should use
         the content database "SP2010_Blob".

  4. Connect to WFE

  5. Go to SharePoint 2010 Central Administration

  6. Under Application Management - Manage Content Databases Choose the applicable
    Web Application from the drop down above

  7. Configure the Content Database to put the next site collection to "SP2010_Blob"

  8. Go back to the main site of Central Administration

  9. Application Management - Create Site Collection

  10. Make sure by going to content database that the site collection we created will be in the
    content database that we configured

To test the RBS data store

  1. Connect to a document library on any Web server.
  2. Upload a file that is at least 100 kilobytes (KB) to the document library.
  3. Documents below 100 kB will not be put to the file system but will be stored in the
    database.
  4. On the computer that contains the RBS data store, click Start, and then click
    Computer.
  5. Browse to the RBS data store directory.
  6. Browse to the file list and open the folder that has the most recent modified date
    (other than $FSLOG). In that folder, open the file that has the most recent modified date.
    Verify that this file has the same size and contents as the file that you uploaded

Author's Bio

Destin Joy is a Microsoft MVP on SharePoint Server. He isan author, speaker and a blogger in Microsoft technology. Currently Destin isin the final phase of creating his second EBook on “SharePoint 2010 CapacityPlanning”, which will be published in C# corner.

MVP Mondays

The MVP Monday Series is created by Melissa Travers. In this series we work to provide readers with a guest post from an MVP every Monday. Melissa is a Community Program Manager for Dynamics, Excel, Office 365, Platforms and SharePoint in the United States. She has been working with MVPs since her early days as Microsoft Exchange Support Engineer when MVPs would answer all the questions in the old newsgroups before she could get to them.

Comments

  • Anonymous
    April 09, 2012
    Excellent,

  • Anonymous
    April 15, 2012
    Very Informative article. Thanks Destin

  • Anonymous
    April 16, 2012
    Good article Destin

  • Anonymous
    April 17, 2012
    Great Article Destin. I have a question I was hoping you could help me with? I have RBS installed and enabled on my SP WFE. I check and it is enabled on the DB. When I upload files a folder in my Blobstor folder is created, but inside only 1 files exists and it is 0KB in size. Am I missing something? All files were 5MB or bigger and uploaded fine, it just appears they are not using RBS as they should. Any help is appreciated. mslomanski AT gmail.com

  • Anonymous
    April 25, 2012
    I want to use Windows azure as file storage instead of local drive. How that would be possible?

  • Anonymous
    September 11, 2013
    Hi all, I have the same problem as Mike Slomanski, my BLOB folder is empty :-/ Still no idea?  

  • Anonymous
    October 21, 2013
    The comment has been removed

  • Anonymous
    January 12, 2014
    The comment has been removed

  • Anonymous
    January 22, 2014
    Very good article which you composed for all. Thanks!!! I need some more clarification which is stick in my mind

  1. How do we set the file size for rbs
  2. How do we set what are the file type need to allow for rbs
  3. How do we set older date files that we need to achieve in rbs Please help to answer the above question with example Thanks in advance