SharePoint Views

Remote BLOB Storage (RBS) with SharePoint 2013 and SQL Server 2012

RBS functionality allows documents and files of size larger than specified limit to be stored in a separate storage drive or device other than content database. This is very useful feature to effectively store large files or documents without rapidly increasing your content database size.

As specified in TechNet, RBS does not increase the size limitations on content database. All limitations still apply to RBS-enabled content databases. RBS is intended to lower storage costs by allowing you to store large read-intensive BLOBs on less expensive drives.

Microsoft currently only supports RBS FILESTREAM provider with SharePoint 2013. Backup and restore features work normally without additional work when FILESTREAM provider is used.


Here are the steps to enable Remote Blob in SharePoint 2013 content databases:

 Step 1: Enable FILESTREAM on SQL Server

  • Log on to SQL Server, from Start menu, open SQL Server Configuration Manager.
  • Select SQL Server Services, in the left pane.
  • Right click and select properties on SQL Server process in right pane SQL Server process
  • In SQL Server Properties, click FILESTREAM tab
  • Select all the check boxes and apply.FILESTREAM
  • In SQL Server Management Studio, select new query and execute the following SQL statements on any database

    EXEC sp_configure filestream_access_level, 2 
    RECONFIGURE

 Step 2: Provision RBS Data Store

  •  Log on to SQL Server, from Start menu, open SQL Server Management Studio
  • Connect to database instance and select the database for which we are enabling RBS.
  • Run the following query to create the master key

USE [Database Name]

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′

Note: Use the exact username and password.

  • Run the following query to create a new file group for RBS

USE [Database Name]

IF not exists (SELECT groupname FROM sysfilegroups WHEREgroupname=N’RBSFilestreamProvider’)alter database [Database Name] add filegroupRBSFilestreamProvider contains filestream

  • Run the following query to add ‘file’ (It can be a folder in a local drive on SQL server or an attached drive. It should not already exist)

USE [Database Name]

alter database [Database Name] add file (name = RBSFilestreamFile, filename = ‘c:\BlobStore’) to filegroup RBSFilestreamProvider     

 

 Step 3: Install Microsoft SQL Server 2012 Remote Blob Store

  • Install Microsoft SQL Server 2012 Remote Blob Store bits on Database and each Web and Application servers. It is available as part of SQL Server 2012 Feature pack. After downloading and saving the installable open command prompt as admin and execute the following command to install

 msiexec /qn /lvx* rbs_install_log.txt /i RBS.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME=”<Database Name>” DBINSTANCE=”<Instance Name>” FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1

        Note: Replace Database name and instance name and also replace RBS.MSI with full path to RBS.MSI

 Step 4: Enable RBS on Content Database

  • To enable RBS on a particular database use the following PowerShell script. Replace the web application name
  • To enable RBS on the content database, you must use PowerShell. Therefore, open up PowerShell or Notepad and create the following PowerShell Script:

$cdb = Get-SPContentDatabase -WebApplication “<Web Application Name>”
$rbss = $cdb.RemoteBlobStorageSettings
$rbss.Installed()  #output should be True here, if not go back to RBS.msi installation
$rbss.Enable()
$rbss.SetActiveProviderName($rbss.GetProviderNames()[0])
$rbss

  • Output of the above script should be similar to thisRBS settings     

 Step 5 : Configure minimum blog storage size

  • Log on to SQL Server, from Start menu, open SQL Server Management Studio
  • Connect to database instance and select the database for which we enabled RBS.
  • Run the following query to set the MinimumBlobStorageSize to 1 MB

          $database = Get-SPContentDatabase “Database Name”

         $database.RemoteBlobStorageSettings.MinimumBlobStorageSize=1048576

         $database.Update()

  • Any file bigger than 1MB will be stored in RBS

 Step 6 : Testing RBS

  • Upload a file of size larger than MinimumBlobStorageSize we set in last step.
  • Browse to RBS file storage location in SQL server
  • Open the folder and observe the file being saved in smaller chunksData in RBS