SharePoint and RBS Maintainer – connection string issues

Recently I have seen an issue with RBS Maintainer that was failing during the execution of the RBS garbage collection.

Issue:

Every time when executing the following command it was failing without deleting the orphan BLOBs

C:Program Files\Microsoft SQL Remote Blob Storage 10.50\Maintainer\Microsoft.Data.SqlRemoteBlobs.Maintainer.exe” -ConnectionStringName RBSMaintainerConnection -Operation ConsistencyCheck GarbageCollection Maintenance -ConsistencyCheckForStores ForceFinalize -GarbageCollectionPhases rdo -ConsistencyCheckMode b

Errors in the SharePoint logs: User does not have permission to perform this action. You do not have permission to run the RECONFIGURE statement.

and a lot of Access Denied at the SQL level (even if the account was added with sysadmin rights)

Cause:

Connection string was corrupted.

RBS requires you to define a connection string to each database that uses RBS before you run the RBS Maintainer. This string is stored in a configuration file in the <RBS installation path>\Microsoft SQL Remote Blob Storage 10.50\Maintainer folder that is ordinarily created during installation. The RBS Maintainer can be run manually by executing the Microsoft.Data.SqlRemoteBlobs.Maintainer.exe program together with the parameters that are listed in the following table.

Resolution:

I found the solution in the following blog http://sqlrbs.codeplex.com/discussions/204627?ProjectName=sqlrbs

For each content Database that is RBS enabled : Add content database connection string to the Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config file

a. Rename the existing config file to web.config using following command (located in %programfiles%\Microsoft SQL Remote Blob Storage 10.50\Maintainer )

cd /d %programfiles%\Microsoft SQL Remote Blob Storage 10.50\Maintainer

ren Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config web.config

b. Un-encrypt the connection strings from the config file by using following command (aspnet_regiis is located in %windir%\Microsoft.NET\Framework64\v2.0.50727

cd /d %windir%\Microsoft.NET\Framework64\v2.0.50727

aspnet_regiis.exe -pdf connectionStrings “%programfiles%\Microsoft SQL Remote Blob Storage 10.50\Maintainer”

c. Add additional connection string to the web.config file for each content database that is rbs enabled like following . Change the name of connection string , data source and Initial Catalog as needed

<connectionStrings>

<add connectionString=”Data Source=localhost;Initial Catalog=RemoteBlobStorage;Integrated Security=True;Application Name=&quot;Remote Blob Storage Maintainer&quot;”

providerName=”System.Data.SqlClient” />

<add connectionString=”Data Source=wsslab40;Initial Catalog=wss_content;Integrated Security=True;Application Name=&quot;Remote Blob Storage Maintainer for WSS_Content&quot;”

providerName=”System.Data.SqlClient” />

</connectionStrings>

d. Encrypt the web.config file again by using following command

cd /d %windir%\Microsoft.NET\Framework64\v2.0.50727

aspnet_regiis -pef connectionStrings “%programfiles%\Microsoft SQL Remote Blob Storage 10.50\Maintainer ” -prov DataProtectionConfigurationProvider

e. Rename the file back to original

cd /d %programfiles%\Microsoft SQL Remote Blob Storage 10.50\Maintainer

ren web.config Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config

At the SQL level if you want to extract and analyze additional information about the RBS you can check the following tables:

•    mssqlrbs.rbs_blob_details

•    mssqlrbs.rbs_consistency_issues

•    mssqlrbs.rbs_history

•    mssqlrbs.rbs_counters

•    rbs_consistency_issues

Additional information about the RBS Maintainer in the following articles:

http://sqlrbs.codeplex.com/ Microsoft SQL Remote Blob Storage (RBS) Samples

http://technet.microsoft.com/en-us/library/ff943566(v=office.14).aspx Maintain RBS (SharePoint Foundation 2010)

http://technet.microsoft.com/en-us/library/ee663474(v=office.14).aspx Install and configure RBS (SharePoint Foundation 2010)

http://blogs.technet.com/b/pramodbalusu/archive/2011/07/09/rbs-and-sharepoint-2010.aspx RBS and SharePoint 2010

http://blogs.msdn.com/b/sqlrbs/archive/2010/03/19/running-rbs-maintainer.aspx Running RBS Maintainer

One thought on “SharePoint and RBS Maintainer – connection string issues

Comments are closed.