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.
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'
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'
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
and a folder name $FSLOG
filestream.hdr file contains the FileStream header information.
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.
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
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
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.