Skip to main content

The SQL Sharding Deployment Tool


An overview of the SQL Sharding Deployment Tool operations and parameters.

The SQL Sharding Deployment Tool is an executable that deploys and manages the xDB Collection database and can be used on its own if you want greater control over parameters, such as the number of shards to deploy. The tool must be run from a local machine. It cannot be uploaded and executed from an Azure environment.


The Sitecore Installation Framework (SIF) and the Sitecore Azure Toolkit (SAT) create two shards by default. To change the number of shards you can either re-deploy the xDB Collection database. For SIF, you can also change the JSON files used during the installation process.


The tool is bundled with the xConnect Collection service and is available in the following web deploy packages (WDP):

Topology name

Example WDP name

Tool location

XP Single (Developer) - On-Prem

Sitecore 10.0.0 rev. 001250 (OnPrem)


XP Single (Developer) - Cloud

Sitecore 10.0.0 rev. 001250 (Cloud)

XP Scaled - On-Prem

Sitecore 10.0.0 rev. 001564 (OnPrem)

XP Scaled - Cloud

Sitecore 10.0.0 rev. 001564 (Cloud)


You can use the SQL Sharding Deployment Tool to:

  • Create the xDB Collection shard cluster (create). For example:

    .\Sitecore.Xdb.Collection.Database.SqlShardingDeploymentTool.exe /operation create /connectionstring "user id=sa;password=12345;data source=./SQL2017;" /shardMapManagerDatabaseName "Sitecore.Xdb.Collection.Database.Sql.ShardMapManagerDb" /shardnumber 2 /shardnameprefix "Sitecore.Xdb.Collection.Database.Sql" /shardnamesuffix "_" /dacpac ".\Sitecore.Xdb.Collection.Database.Sql.dacpac"
  • Drop the xDB Collection shard cluster (drop). For example:

    .\Sitecore.Xdb.Collection.Database.SqlShardingDeploymentTool.exe /operation drop /connectionstring "user id=sa;password=12345;data source=.\SQL2017;" /shardMapManagerDatabaseName "Sitecore.Xdb.Collection.Database.Sql.ShardMapManagerDb"
  • Add a shard to the shard cluster (addShard). For example:

    .\Sitecore.Xdb.Collection.Database.SqlShardingDeploymentTool.exe /operation addShard /connectionstring "user id=sa;password=12345;data source=./SQL2017;" /shardMapManagerDatabaseName "Sitecore.Xdb.Collection.Database.Sql.ShardMapManagerDb" /shardConnectionString "user id=sa;password=12345;data source=./SQL2017;" /shardnameprefix "Sitecore.Xdb.Collection.Database.Sql" /shardnamesuffix "_" /dacpac ".\Sitecore.Xdb.Collection.Database.Sql.dacpac"


    This command is only available with a cloud environment, and not on-prem.

  • Remove a shard from the shard cluster (deleteShard). For example:

    .\Sitecore.Xdb.Collection.Database.SqlShardingDeploymentTool.exe /operation deleteShard /connectionstring "user id=sa;password=12345;data source=.\SQL2017;" /shardMapManagerDatabaseName "Sitecore.Xdb.Collection.Database.Sql.ShardMapManagerDb" /shardConnectionString "user id=sa;password=12345;data source=.\SQL2017;" /shardDatabaseName "Sitecore.Xdb.Collection.Database.Sql2_"
  • Print shard map key ranges (printMapping). For example:

    .\Sitecore.Xdb.Collection.Database.SqlShardingDeploymentTool.exe /operation printMapping /connectionstring "user id=sa;password=12345;data source=.\SQL2017;" /shardMapManagerDatabaseName "Sitecore.Xdb.Collection.Database.Sql.ShardMapManagerDb"
  • Register schema for ShardMapManager (registerSchema). For example:

    .\Sitecore.Xdb.Collection.Database.SqlShardingDeploymentTool.exe /operation registerSchema /connectionstring "user
    id=sa;password=12345;data source=.\SQL2017;" /shardMapManagerDatabaseName "Sitecore.Xdb.Collection.Database.Sql.ShardMapManagerDb"


Using the SQL Sharding Deployment Tool to add or remove shards does not automatically split and merge existing data. You use the SQL Sharding Deployment Tool as part of performing the split and merge operation.

Registering a schema is one of the prerequisites for the split and merge operation. If schemas are not registered, the split and merge operation cannot migrate the data.


The following table describes the parameters used by the SQL Sharding Deployment Tool. Different operations accept a specific set of parameters.

Parameter name



Values / examples



Specifies which operation to perform.

  • create

  • drop

  • addShard

  • deleteShard

  • printMapping

  • registerSchema



SQL Server connection string used to create the database.

"user id=sa;password=SamplePassword;data source=.\SQL2016"



Azure SQL DTU-based service tiers . This value is only used if you are deploying to Azure SQL.

  • Basic

  • Standard

  • Premium

  • GeneralPurpose

  • BusinessCritical



The name of the shard map manager database.

Example: Sample_ShardMapManagerDb



The number of shards to create.




Format is {Prefix}{Number}{Suffix}.

Example: Sample.Shard



Format is {Prefix}{Number}{Suffix}. Suffix can be left blank.

Example: _ABC



Path to DACPAC file. By default, DACPAC files are in the same folder as the tool.

  • Sitecore.Xdb.Collection.Database.Sql.dacpac



Path to log file. If no log file is specified, output is written to console.



Used by the addShard and /deleteShard operations.



Used by the /deleteShard operation.



Optional parameter, used by the /addShard operation. Forces the shard to be added without a schema comparison.

- true

- false



The name of the registered elastic pool to deploy cluster databases within. The argument is SQL Azure specific.

Use with create and addShard.