?Author: Bill Baer, Senior Technical Product Manager, Microsoft Corporation - SharePoint
FILESTREAM is a new feature in SQL Server 2008 that enables the storage of unstructured data on a NTFS file system. FILESTREAM (local or remote) is supported in SharePoint 2010 as one mechanism of reducing capital expenditures through enabling the storage of large binary unstructured data on content addressable or commodity storage.Unstructured data refers to information that does not adhere to a defined model or does not fit well into relational tables in SharePoint unstructured data can refer to Microsoft Office document file formats, video, audio, and related file types.Structured data in SharePoint refers to the metadata associated with its corresponding unstructured data or BLOB. Relational databases are most often cited as examples of structured data.SQL Server and Unstructured Data StorageThere are three (3) approaches to storing unstructured data with SQL Server, RBS, SQL BLOB, and FILESTREAM:Remote BLOB Storage (RBS) in which SharePoint relies on a new layer in SQL Server to read or update BLOB data stored outside of the database on separate BLOB Stores (file system or dedicated BLOB stores) SQL BLOB which refers to traditional BLOB storage with SharePoint, BLOB data is stored along side the structured metadata in the Content Database FILESTREAM FILESTREAM is implemented on the varbinary(max) datatype instructing the database engine to store unstructured data on the file system through a FILESTREAM filegroup that contains file system directories instead of the files themselves also known as data containers. Data containers are the interface between database engine storage and file system storage. varbinary is the binary data type designation for binary large objects stored in SharePoint 2010 content databases and refers to variable-length binary data. (MAX) refers to a value that max indicates that the maximum storage size is 2^31-1 bytes or otherwise 2GB. Remote BLOB Storage does not provide a mechanism to exceed to the 2GB file size limit imposed by SharePoint.In SharePoint 2010 remote BLOB data is referenced by a unique identifier in content databases configured for RBS (see illustration).1. On the Start menu, point to All Programs, point to Microsoft SQL Server 2008 (R2), point to Configuration Tools, and then click SQL Server Configuration Manager. 2. In the list of services, right-click SQL Server Services, and then click Open. 3. In the SQL Server Configuration Manager snap-in, locate the instance of SQL Server on which you want to enable FILESTREAM. 4. Right-click the instance and then click Properties. 5. In the SQL Server Properties dialog box, click the FILESTREAM tab. 6. Select the Enable FILESTREAM for Transact-SQL access check box. 7. If you want to read and write FILESTREAM data from Windows, click Enable FILESTREAM for file I/O streaming access. Enter the name of the Windows share in the Windows Share Name box. 8. If remote clients must access the FILESTREAM data that is stored on this share, select Allow remote clients to have streaming access to FILESTREAM data. 10. Click Start, click All Programs, click Microsoft SQL Server 2008 (R2), and then click SQL Server Management Studio. 11. In SQL Server Management Studio, click New Query to display the Query Editor. 12. In Query Editor, enter the following Transact-SQL code: EXEC sp_configure filestream_access_level, 2In Query Editor, enter the following Transact-SQL code:
1. Click Start, click All Programs, click Microsoft SQL Server 2008 (R2), and then click SQL Server Management Studio. 3. Select the content database for which you want to create a BLOB store, and then click New Query. 4. In SQL Server Management Studio, click New Query to display the Query Editor. 5. In Query Editor, enter the following Transact-SQL code: 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'In Query Editor, enter the following Transact-SQL code: if not exists (select groupname from sysfilegroups where groupname=N'RBSFilestreamProvider')alter database [Database Name] add filegroup RBSFilestreamProvider contains filestreamIn Query Editor, enter the following Transact-SQL code: alter database [Database Name] add file (name = RBSFilestreamFile, filename = 'c:\BlobStore') to filegroup RBSFilestreamProviderInstall the Microsoft SQL Server 2008 R2 Remote Blob StoreOpen a Command Prompt with Administrator permissions and execute the following command to install RBS.MSI downloaded in the previous step:msiexec /qn /lvx* rbs_install_log.txt /i RBS.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="
1. On the Start menu, click All Programs. 2. Click Microsoft SharePoint 2010 Products. 3. Click SharePoint 2010 Management Shell. 4. In the SharePoint 2010 Management Shell, enter the following Windows PowerShell statement to set the content database to be configured:The result of $rbs.Installed() should be True, if the result is False, verify RBS.MSI has been installed successfully by reviewing rbs_install_log.txt. Ensure the install statement was running In the SharePoint 2010 Management Shell, enter the following Windows PowerShell statement to enable RBS for the selected content database:In the SharePoint 2010 Management Shell, enter the following Windows PowerShell statements to set the RBSprovider for the selected content database:$database=Get-SPContentDatabase –Identity “Database Name”In the SharePoint 2010 Management Shell, enter the following Windows PowerShell statement to gets the object that holds settings that determine how the content database uses Microsoft SQL Server Remote Blob Storage:$rbs=$database.RemoteBlobStorageSettingsIn the SharePoint 2010 Management Shell, enter the following Windows PowerShell statement to determine if RBS has been installed for the selected content database:
$rbs.SetActiveProviderName($rbs.GetProviderNames()[0])The result of $rbs should be:
To configure the MinimumBlobStorageSize:
1. On the Start menu, click All Programs. 2. Click Microsoft SharePoint 2010 Products. 3. Click SharePoint 2010 Management Shell. 4. In the SharePoint 2010 Management Shell, enter the following Windows PowerShell statements to configure the MinimumBlobStorageSize at 1MB:To validate the FILESTREAM configuration and RBS installation:$database = Get-SPContentDatabase “Database Name” $database.RemoteBlobStorageSettings.MinimumBlobStorageSize=1048576UpgradePersistedProperties specifies the collection of field names and values for fields that were deleted or changed.
1. Click Start, click All Programs, click Microsoft SQL Server 2008, and then click SQL Server Management Studio. 3. Select the content database for which you want to create a BLOB store, and then click New Query. 4. In SQL Server Management Studio, click New Query to display the Query Editor. 5. In Query Editor, enter the following Transact-SQL code:
SELECT * FROM dbo.DatabaseInformationConfirm that both the RBSCollectionId and RBSProvider rows are available.
1. Select a desired Document Library on a site in the configured content database. 2. Upload a file that is greater than 1 MB. 3. On the computer that contains the RBS data store, click Start, and then click Computer. 4. Browse to the RBS data store directory. 5. 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. If it does not, ensure that RBS is installed and enabled correctly.The data store directory structure will appear similar to that in the following diagram.


1 comments:
Hi there, awesome site. I thought the topics you posted on were very interesting.
Sharepoint Remote Blob Storage
Post a Comment