Tag Archives: Get-SPContentDatabase


content database in sharepoint

content database in sharepoint

A content database in sharepoint is not the database server itself but container for all the content for a single web application.

content database in sharepoint

You can have only one content database for one web application however, you can separate content for multiple websites into multiple content databases for a site collection. You can also use a single content database for multiple site collections, keeping in mind that the site collection or collections represent a single web app.

we can run the powershell command as below to get quick details however can get from “Central Admin -> Application Management”  under “View all Site Collections”.


Isolation and sharing are expressed as the difference between one site collection using one database and numerous site collections sharing a database. The number of site collections using a database is also a scaling and performance issue. If you are deploying site collections with a high workload attached and greater expectancy for growth, make sure to use fewer site collections per database. You can also plan your content database strategy by adding databases to site collections as they grow or associate specific site collections only with specific content databases. The latter approach lets you isolate a database serving particular site collections from all the other databases and thus isolate the content it contains.

boundaries and limits content databases

There can be 500 content databases per farm at max. With 200GB data per content database and 100TB of data per farm. 60 million items including documents and list items. Number of site collections per content database recommended to 5,000. However, up to 10,000 site collections are supported.2500 non-Personal site collections and 7500 Personal Sites or 10000 Personal Sites alone. find in details from Microsoft Doc Link.

content database for each site collection powershell

We can run below powershell command to know which content database your site collection attached to.

$site = Get-SPSite "http://win2016:37344/sites/SPmcse"
write-host $site.WebApplication.ContentDatabases


(Get-SPSite $url).ContentDatabase.name

Get SharePoint Site Content Database using Powershell | #SharePoint2019, #ContentDatabase

Get SharePoint Site Content Database using Powershell | #SharePoint2019, #ContentDatabase

maximum number of site collections per content database

Set maximum number of site collections per content database

For Particular Requirement, client want to dedicate a database for a single site collection. When we create a site collection from central admin, site is placed automatically in any available content database. To prevent any other sites to be created on the particular content database, We can set maximum number of site collections on particular content database. Follow steps below :

  • Central Administration -> Application Management -> Management Content databases
  • Select our target web application in which the particular content database is attached
  • Pick the target database from the list
  • Now, in the “Manage Content Database Settings” page we can set the maximum number of sites for the content database.
maximum number of site collections
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Variables for processing
$WebAppURL ="https://sharepointtechnicalsupport.com"
$WarningSiteCount = 0

#Get all content databases of the web application
$ContentDBColl = Get-SPContentDatabase -webapplication $WebAppURL

#Iterate through each database in the web application
foreach($Database in $ContentDBColl)
#Check the current No. of sites
if($MaxSiteCount -ge $Database.CurrentSiteCount)
#Set Maximum Sites, warning level Counts
Set-SPContentDatabase -Identity $Database.Name -MaxSiteCount $MaxSiteCount -WarningSiteCount $WarningSiteCount
Write-host "Max Sites Settings updated for the database:" $Database.name -ForegroundColor Green
write-host "MaxSiteCount must be > = current site count! No changes made in $($Database.Name)" -ForegroundColor Red