Share via


Maintain RBS (SharePoint Foundation 2010)

 

Applies to: SharePoint Foundation 2010

This article describes how to perform maintenance tasks that are associated with Remote BLOB Storage (RBS) in Microsoft SharePoint Foundation 2010.

You perform most of the maintenance tasks associated with RBS in SharePoint Foundation 2010 by using the RBS Maintainer, which is a tool in Microsoft SQL Server. The RBS Maintainer performs periodic garbage collection and other maintenance tasks for a SharePoint 2010 RBS deployment. You can schedule these tasks for each database that uses RBS by using Windows Task Scheduler or Microsoft SQL Server Agent. You must provision the RBS Maintainer by using command-line parameters or through an XML file. In the case of mirrored or replicated databases, you can run the RBS Maintainer against any single instance.

In this article:

  • Garbage collection

  • RBS and BLOB store consistency checks

  • Running the RBS Maintainer

Garbage collection

SharePoint Foundation 2010 automatically marks unreferenced or deleted BLOB data for removal. SharePoint Foundation 2010 counts references to BLOBs by looking at the list of BLOB IDs stored by SharePoint Foundation 2010 in its content databases at the time of removal. Any BLOB references that are present in the RBS store tables but absent in the content database are assumed to be deleted by SharePoint Foundation 2010 and will be marked for removal. BLOBs that are not present in the content database and were created before the orphan cleanup time window, described later in this article, are also assumed to be deleted by SharePoint Foundation 2010 and will be marked for removal.

Because SharePoint Foundation 2010 tabulates BLOB references from the RBS columns of the content database, every RBS column must have a valid index before it can be registered in RBS.

The SQL Server RBS Maintainer tool removes the items marked by SharePoint Foundation 2010 for removal. You should schedule the clean-up tasks to be run during off-peak hours to reduce the effect on regular database operations.

RBS garbage collection is performed in the following three steps:

  • Reference scan. The first step compares the contents of the RBS tables in the SharePoint Foundation 2010 content database with RBS's own internal tables and determines which BLOBs are no longer referenced. Any unreferenced BLOBs are marked for deletion.

  • Delete propagation. The next step determines which BLOBs have been marked for deletion for a period of time longer than the garbage_collection_time_window value and deletes them from the BLOB store.

  • Orphan cleanup. The final step determines whether any BLOBs are present in the BLOB store but absent in the RBS tables. These orphaned BLOBs are then deleted.

Configuring RBS garbage collection

You can configure garbage collection by specifying the following RBS Maintainer settings and database settings:

  • Maintainer schedule. This setting determines how often the RBS Maintainer will be run.

  • Task Duration. This setting determines the maximum length that a single RBS Maintainer task can run. The default setting is two hours.

You should configure the RBS Maintainer so that its activity has minimal effect on regular activity. For information about database garbage collection settings, including how to configure the settings, see Running RBS Maintainer (https://go.microsoft.com/fwlink/p/?LinkId=199638).

RBS and BLOB store consistency checks

The RBS Maintainer verifies the integrity of RBS BLOB references and corrects any errors that are found. It performs several consistency checks for the database, such as verifying that indexes exist for the RBS columns, and verifying that all BLOBs that are referenced by SharePoint Foundation 2010 exist in RBS.

The Auxiliary Table Consistency Check verifies that the RBS auxiliary tables are in a consistent state. The checks performed are the following:

  • Verify that each RBS table column has a valid index.

  • Verify that RBS table columns exist; have enabled, valid indexes; and have the correct column type.

Although you can disable the following consistency checks, we recommend that you do not disable them because they help ensure the consistency of your RBS store. By default, the following consistency checks are enabled:

  • Verify that all BLOBs that are referenced by SharePoint Foundation 2010 are present in the RBS tables.

  • Verify that no BLOBs are marked as both in use and deleted.

Any discovered problems are logged and the RBS Maintainer attempts to fix them by creating missing index entries, unregistering missing columns, or marking in-use BLOBs as not deleted.

Running the RBS Maintainer

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.

Parameter name Description Values Required?

ConnectionStringName <string name>

The name of the connection string for the configuration file.

RBSMaintainerConnection is the default name that is created during RBS setup.

Yes

Operation <space-separated list of operations to perform>

The garbage collection operations to perform. This parameter takes one to four arguments. The ForceFinalize value cannot be used in combination with any other operation.

ConsistencyCheck

GarbageCollection

Maintenance

ConsistencyCheckForStores

ForceFinalize

Yes

GarbageCollectionPhases <phases>

The garbage collection phases to perform. This parameter is used to run or complete the garbage collection. The value must be one or more letters without spaces.

r — Reference scan.

d — Delete propagation.

o — Orphan cleanup.

Yes, if garbage collection is to be performed.

ConsistencyCheckMode <c, r, or b>

Specifies the kind of consistency check to be performed.

c — Only a check will be performed.

r  — A check will be performed and any issues found will be repaired.

b  — A check, repair, and rebuild of the internal data structures.

Yes, if a consistency check is to be performed.

ConsistencyCheckExtent <m or c>

Specifies the extent of the consistency check.

m — Only metadata will be checked; individual BLOBs will remain unchecked. This is the default parameter.

c — A complete check will be performed.

If not specified, m is assumed.

ConsistencyCheckForStores <space-separated list of BLOB store names>

Lists the names of the BLOB stores that will be checked for consistency.

By default, all BLOB stores are checked.

No

TimeLimit <time in minutes>

Specifies the time that is available for the RBS Maintainer to perform its tasks. The argument must be a positive integer.

No

You must schedule a separate RBS Maintainer task for every database that uses RBS. The following steps describe how to schedule an RBS Maintainer task.

To schedule an RBS Maintainer task

  1. Verify that you have Write permissions for the folder where you installed RBS.

  2. Add a connection string to the <RBS installation directory>\Maintainer\Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config file for the RBS Maintainer task that is to be performed. The RBS installer creates one connection string that is named RBSMaintainerConnection by using the connection information that was provided during setup. However, new connection strings must be added for every additional database.

    If you are using Windows authentication, the connection string does not have to be encrypted. You can add the unencrypted connection string by running the following command:

    aspnet_regiis -pef connectionStrings . -prov DataProtectionConfigurationProvider
    rename web.config Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config

    If you are using SQL authentication, the RBS Maintainer connection strings must be in an encrypted format. Therefore, to add connection strings, either the new strings must be encrypted or all the connection strings must be decrypted. Encrypted strings must be added one at a time. However all the connection strings can be decrypted at the same time by using the %windir%\Microsoft.net\Framework\<version>\Aspnet_regiis.exe tool, which is distributed as a part of the Microsoft .NET Framework.

    Run the following commands to decrypt the connection strings and store the results in a Web.config file:

    rename Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config web.config
    aspnet_regiis -pdf connectionStrings

    Strings can then be added in decrypted form and the file can be encrypted and renamed to Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config by using the following commands:

    aspnet_regiis -pef connectionStrings . -prov DataProtectionConfigurationProvider
    rename web.config Microsoft.Data.SqlRemoteBlobs.Maintainer.exe.config

  3. Create a Windows scheduler task to run the RBS Maintainer task for each applicable database. If you ran the RBS installer in GUI mode, it automatically created a Windows scheduler task. However, if you ran the RBS installer in command-line mode, you must perform the following steps every time that you schedule a task to run the RBS Maintainer:

    1. On the Start menu, click Administrative Tools, and then click Task Scheduler.

    2. On the Action menu, click Create Task.

    3. On the Actions tab, click New.

    4. In the New Action dialog box, in the Action drop-down list, select Start a program.

    5. Under Settings, in the Program/script box, browse to the Maintainer binary file <RBS installation directory>\Maintainer\Microsoft.Data.SqlRemoteBlobs.Maintainer.exe, and in the Add arguments (optional) text box, add any optional arguments. The following default values are created by the installer:
      <-ConnectionStringName RBSMaintainerConnection>
      <-Operation GarbageCollection ConsistencyCheck ConsistencyCheckForStores>
      <-GarbageCollectionPhases rdo>
      <-ConsistencyCheckMode r>
      <-TimeLimit 120>

    6. Click OK.

    7. On the Triggers tab, click New.

    8. In the New Trigger dialog box, schedule the task, and then click OK. We recommend that you schedule the task to run during low system activity times.

    9. On the General tab, under Security, ensure that the user account has the correct permissions to run the task. You can change permissions by clicking Change User or Group.

    10. On the General tab, click Run whether user is logged on or not, and then click OK.

See Also

Concepts

Overview of RBS (SharePoint Foundation 2010)
Plan for RBS (SharePoint Foundation 2010)
Install and configure RBS (SharePoint Foundation 2010)
Install and configure RBS with a 3rd party provider (SharePoint Foundation 2010)
Set a content database to use RBS (SharePoint Foundation 2010)
Migrate content into or out of RBS (SharePoint Foundation 2010)
Disable RBS on a content database (SharePoint Foundation 2010)

Other Resources

Upgrading from a stand-alone installation of Windows SharePoint Services 3.0 to SharePoint Foundation 2010 when content databases exceed 4 GB (RBS)