Having a dedicated content database for each site collection is recommended for larger SharePoint site collections.
But wait, this will not stop SharePoint from placing new site collections to the content database created (SP2010_Content_Sales)! we've to set the MaxSiteCount and WarningSiteCount values to control any future sites.
PowerShell script to Create site collection in specific content database:
If you want to create new site collection in an existing content database, use this PowerShell script: Say, we've an existing content database: SP2013_Content_Sales and want to create our new site collection in it.
This PowerShell creates site collection in specific content database.
Create site collection in New content database in SharePoint 2010 using PowerShell:
As the Central Administration doesn't provide any direct interface, lets use PowerShell cmdlet to create site collection in new content database for SharePoint 2010 / SharePoint 2013:#Create a New Content DatabaseThe above PowerShell script creates new content database and creates site collection in that particular database. Here, Use "-ContentDatabase" parameter to set the target content database.
New-SPContentDatabase -name SP2010_Content_Sales -webapplication http://sharepoint.crescent.com
#Create a Site collection in the specific content database
New-SPSite -Name "Sales" -ContentDatabase SP2010_Content_Sales -url http://sharepoint.crescent.com/sites/Sales/ -OwnerAlias "global\User1" –SecondaryOwnerAlias "corp\user2"
But wait, this will not stop SharePoint from placing new site collections to the content database created (SP2010_Content_Sales)! we've to set the MaxSiteCount and WarningSiteCount values to control any future sites.
$SiteURL= "http://sharepoint.crescent.com/sites/Sales/"
#Get the Content Database of the site collection and set Maximum & Warning levels for the Sites.
Get-SPContentDatabase -Site $siteURL | Set-SPContentDatabase -MaxSiteCount 1 -WarningSiteCount 0
PowerShell script to Create site collection in specific content database:
If you want to create new site collection in an existing content database, use this PowerShell script: Say, we've an existing content database: SP2013_Content_Sales and want to create our new site collection in it.
This PowerShell creates site collection in specific content database.
Add-PSSnapin Microsoft.SharePOint.PowerShellIf you don't want to use PowerShell, its still possible to create site collection in new content database using STSADM and with a Central Admin tweak! Here are the workarounds: Create site collection in new / specific content database SharePoint 2007
$SiteURL = "http://sharepoint.crescent.com/sites/Sales"
#Set exisiting Content Database
$DatabaseName = "SP2013_Content_Sales"
$PrimaryOwner = “Global\SPFarmAdmin”
$SecondaryOwner = “Global\Salaudeen”
#Create new Site collection on the specific content database
New-SPSite $SiteURL -OwnerAlias $PrimaryOwner -SecondaryOwnerAlias $SecondaryOwner -ContentDatabase $DatabaseName