SharePoint Content Databases – Top 10 Frequently Asked Questions

Content databases are the single most significant artifacts in SharePoint, and content databases are the repository where all SharePoint content lives. Let me summarize some of the frequently asked questions on SharePoint content databases.

SharePoint Content Databases Frequently Asked Questions

1: Can a Site Collection spit into one or more Content Databases?
No! This is by a design limitation. Any SharePoint content database can have one or more site collections, but the reverse is impossible. One Site collection cannot be spitted into more than one content database.

2: How to get all content Databases of my SharePoint Farm?
To get all content databases that are in use:

Get-SPDatabase | Sort-Object Name | Format-Table Name 

Get All SharePoint Databases – including which are not currently attached to SharePoint web apps:

Get-SPContentDatabase | Sort-Object Name | Format-Table Name 

3. SharePoint content database recommended size?
Recommended size: 100 GB. 200 GB Max for SharePoint 2016! In special scenarios, up to 4 TB! Refer Software boundaries and limits for SharePoint Servers 2016 and 2019. And you can have up to 500 content databases per SharePoint 2016 farm!

4. How to Get the Content Database Size?
The content database size can be retrieved using this PowerShell:

[Math]::Round(((Get-SPContentDatabase "SP16_Content_Crescent_Intranet").DiskSizeRequired)/1GB,2)

To get all Database sizes in E-mail, use this PowerShell script: SharePoint Content Databases Size Report

5. How to get all Content Databases of a SharePoint Web Application?
Go to: SharePoint 2016 Central Administration >> Application Management >> Manage Content databases >> Pick your web application to get the list of content databases associated.

Content Database in SharePoint

You can get all content databases of a web application using PowerShell:

(Get-SPWebApplication "https://intranet.crescent.com/").ContentDatabases | Select -ExpandProperty Name

6. How to Find in which content database a specific site collection is stored?
To get in which content database site collection lives, Go to SharePoint 2013 Central Administration >> Application Management >> View all site collections >> Pick your site collection. Now, you’ll find the content database of the site collection as in below screen:

content database in sharepoint 2013

Use this PowerShell script to find the content database of the site collection:

(Get-SPSite "https://intranet.crescent.com").ContentDatabase.Name

To get the content database for each site collection, refer: Get Content Database for All Site collections

7. How to get all Site collections in a content database?
To find all SharePoint site collections which are stored inside a content database, use this PowerShell script:

(Get-SPContentDatabase "SP16_Content_Crescent_Intranet").Sites | Select URL

Refer to this post to get all site collections of all content databases: Get All SharePoint Site Collections in All Content Databases

8. Can I create a Site Collection in a particular Content Database?
Yes! You can. By default, SharePoint uses the logic: The largest difference between the Maximum Number of Site Collections and the Current Number of Site Collections to create site collections. You can’t specify a particular content database through SharePoint Central Administration. However, Using PowerShell, You can create a site collection in a specific content database: Create Site Collection in New/Specific Content Database

9. How to move a Site collection from one Content Database to Another?
Use: Move-SPSite cmdlet to move a SharePoint site collection from one content database to another. Refer to this post for more detailed instructions: Move site collection from One Content Database to Another

10. How to set the SharePoint content database to read-only?
You can set the SharePoint content database to read-only from SQL Server Management Studio or PowerShell. Refer: How to Set SharePoint 2013 Content Database to Read Only Mode?

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply