Tag Archives: Get-SPContentDatabase

sharepoint-content-database-1920x1080

content database in sharepoint

Advertisements
Advertisements

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.

manage-content-databases-1277x640
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”.

Get-SPContentDatabase
Get-SPContentDatabase-985x390
Get-SPContentDatabase-1898x653
Get-SPContentDatabase-1896x636
Advertisements
Advertisements

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.

Advertisements
Advertisements

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

or

$url="http://win2016:37344/sites/SPmcse"
(Get-SPSite $url).ContentDatabase.name
Get-SPContentDatabase-1920x1303
Get-SPContentDatabase-1048x480
Advertisements
maximum-number-of-site-collections-1920x1080

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.
Advertisements
Advertisements
maximum number of site collections
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Variables for processing
$WebAppURL ="https://sharepointtechnicalsupport.com"
$MaxSiteCount=1
$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
}
else
{
write-host "MaxSiteCount must be > = current site count! No changes made in $($Database.Name)" -ForegroundColor Red
}
}
Advertisements
Advertisements