In this post, we’ll get all content databases per farm, all content databases size per web application in SharePoint Farm.
Addiotnaly, we’ll explore the following:
- 1 SharePoint Content Databases List Per Farm
- 2 How many Content Databases per farm?
- 3 SharePoint Content Databases List Per Web Application
- 4 How many Content Databases per Web Application?
- 5 What’s the Current Content Database size Per Web Application?
- 6 Web Application Vs Content Database Vs Site Collection Vs SubSites
- 7 PowerShell Script to get all Content Database details per SharePoint farm
- 8 SharePoint Farm Scan Report
You may also like to check the full “SharePoint Farm Scan Report” PowerShell Script.
It’s a database that stores content for one or multiple site collections for a web application.
- The supported limit for SharePoint Content Databases per farm is 500 content databases.
- SharePoint 2019 supports 100TB of data for all content databases per farm.
- It’s strongly recommended to use Windows Authentication when you create a new content database.
- Keep content databases below 200 GB for general usage.
- If the content database holds more than one site collection, the site collection should not exceed 100 GB.
- To avoid large content database size, you should deploy multiple content databases per web application.
- It’s very difficult and time-consuming to operate (backup – restore -upgrade) a large content database size.
You may also like to read SharePoint 2019: SQL Server Recommendations
Get All Content Databases Per Farm
In Central Administration, you can get the full list of Content Databases per web application.
Actually, it’s almost difficult to get the full list of content databases per farm!
Get Content Databases Per Farm Using PowerShell
In this case, you should use PowerShell to list the content databases per farm as the following:
- Open SharePoint Management Shell as Administrator.
- Run the below cmdlet.
Get-SPContentDatabase
Below is the result of running “Get-SPContentDatabase” to get content databases list per farm.
The “Get-SPContentDatabase” cmdlet will also help you to get
- Its associated web applications,
- The number of site collections per content database.
How many Content Databases per farm?
As we earlier mentioned, the supported limit for SharePoint Content Databases per farm is 500 content databases.
In this section, we’ll learn how to get the count of Content Databases per farm using PowerShell as the following:
- Open SharePoint Management Shell as Administrator.
- Run the below cmdlet.
$CDBCount = (Get-SPContentDatabase).count Write-Host "the number of content databases per farm" $CDBCount -ForegroundColor green
You may also like to read Gell All Site Collections and SubSites Per Farm.
In this section, we’ll learn how to get the list of content databases per web application using PowerShell and Central Administration.
Content Databases List Per Web Application Using Central Administration
To get the list of content databases using central administration, you should do the following:
- Open Central Administration, below Application Management, click on “Manage content databases”.
- You can get the list of content databases per a specific web application by clicking on “Change Web Application” and select the web application that you need to list its content databases.
Content Databases List Per Web Application Using PowerShell
Besides the Central Administration, you can use the PowerShell to get the list of content databases per a specific web application.
- Open SharePoint Management Shell as Administrator.
- Run the below cmdlet.
Get-SPContentDatabase -WebApplication "Web App URL"
Below is the result of running “Get-SPContentDatabase” to get content databases list per web application.
How many Content Databases per Web Application?
In this section, we’ll learn how to get the count of Content Database per Web Application using PowerShell as the following:
- Open SharePoint Management Shell as Administrator.
- Run the below cmdlet.
$CDBCount = (Get-SPContentDatabase -WebApplicati on http://epm:7000).count Write-Host "the number of content databases" $CDBCount -ForegroundColor green
What’s the Current Content Database size Per Web Application?
Unfortunately, you can’t know the current size of the SharePoint Content Database through the Central Administration.
However, you can get the SharePoint content database size using PowerShell as well as SQL Server.
Below are the steps to know What’s the size of the SharePoint content database per web application using PowerShell:
- Open SharePoint Management Shell as Administrator.
- Run the below cmdlet
Get-SPContentDatabase -WebApplication "WebAppURL" | select name, @{Name="Contenet Database Size (MB)"; Expressio n={$_.disksizerequired/1MB}}
To get the content database size in GB, you should divide the value on 1024MB as this $_.disksizerequired/1024MB.
Keep content databases below 200 GB for general usage.
You can also get the database size in SQL Server by running the below query.
EXEC sp_helpdb @dbname= 'Database Name'
Another query to get the database size in SQL Server by selecting first the database, then run the below query.
exec sp_spaceused
Web Application Vs Content Database Vs Site Collection Vs SubSites
- Each web application can hold multiple Content Databases.
- Each web application can hold multiple Site Collections.
- Each Content Database can hold multiple Site Collections.
- Site Collection can be only stored in one Content Database.
- You can’t create a site collection without having a web application with a content database.
- Each Site Collection can hold multiple SubSites.
- Each SubSite can also hold additional SubSites.
- You can’t create a subsite without having a top-level site collection.
You may also like to read
In this section, we’ll introduce a simple PowerShell script that helps you to get the following:
- The list of all SharePoint Content Databases per farm.
- The list of all SharePoint Content Databases per web application.
- What’s the content database’s current size?
- How many site collections per each content database?
- What’s the associated web application for each content database?
- A warning alert if the number of content databases per farm is exceeded the supported limit.
- A warning alert if the size of a content database is exceeded the supported limit.
Download the “Content databases per SharePoint farm” script on GitHub.
SharePoint Farm Scan Report is a PowerShell Script that helps you to scan farm objects to monitor the SharePoint farm limits by getting real statistics that would help you to administrate your farm effectively and efficiently.
SharePoint Farm Scan Report Statistics includes:
- List of SharePoint web applications per farm.
- The number of SharePoint web applications per farm.
- List of SharePoint Application Pools.
- The number of SharePoint application pools.
- List of running SharePoint service applications per farm.
- The number of running SharePoint service applications per farm.
- List of SharePoint content databases per farm.
- The number of SharePoint content databases per farm.
- List of SharePoint content databases per web application.
- The number of SharePoint content databases per web application.
- What’s the current content database size?
- List of SharePoint site collections per farm
- The number of SharePoint site collections per farm.
- List of SharePoint site collections per web application
- The number of SharePoint site collections per web application.
- List of SharePoint site collections per content database.
- The number of site collections per content database.
- Which content database stores the site collection?
- What’s the Site collection size?
- List of SharePoint SubSites Per farm.
- The number of SharePoint SubSites per farm.
- List of SharePoint SubSites per site collection.
- Total number of SubSites per site collection.
- Farm Report Summary.
Download the “SharePoint Farm Scan Report” full script on GitHub.
Applies to
- SharePoint 2019.
- SharePoint 2016.
- SharePoint 2013 / SharePoint 2010.
Download
- PowerShell Script: SharePoint Farm Scan Report.
- PowerShell Script: Web applications and application pools per SharePoint farm.
- PowerShell Script: Content database per SharePoint farm.
- PowerShell Script: Site collections and Subsites per SharePoint farm.
Conclusion
In conclusion, we have learned the following:
- SharePoint Content Databases List Per Farm
- What’s the SharePoint Content Database?
- SharePoint Content Database Limits and Recommendations
- Get Content Databases Per Farm Using PowerShell
- How many Content Databases per SharePoint farm?
- SharePoint Content Databases List Per Web Application
- How many Content Databases per Web Application?
- What’s the Current Content Database size Per Web Application?
- Get SharePoint Content Database Size Using PowerShell
- Get SharePoint Content Database Size In SQL Server
- Web Application Vs Content Database Vs Site Collection Vs SubSites
- PowerShell Script to get all Content Database details per farm
- SharePoint Farm Scan Report
You may also like to read
- SharePoint Farm Scan Report.
- Get All Web Applications Per Farm.
- Gell All Site Collections and SubSites Per SharePoint Farm.
- SharePoint 2019: Service Accounts Recommendations.
- SharePoint 2019: SQL Server Recommendations.
- SharePoint 2019 Limitations.
Have a Question?
If you have any related questions, please don’t hesitate to Ask it at deBUG.to Community.
Pingback: PowerShell Script: SharePoint Farm Scan Report | SPGeeks
Pingback: Get All Web Applications Per Farm | SPGeeks