Can i Shrink SharePoint Content database Data file in production environment?

prabhat tunuguntla 1 Reputation point
2022-01-27T11:50:00.95+00:00

Dear All,

We have one site collection in the production environment, In that site collection we have several lists and document libraries. Total size of the content database is 167 GB and available free space is 88.4 GB (52% free space).

we are using SharePoint 2016 environment and Microsoft SQL Server 2016 (SP1). We cant move document libraries or lists to other site collections. Can we shrink SharePoint content database data file? it has crossed more than 50 percent. It might cross 200 GB soon. Please Share your input.

There is no official documentation for SharePoint 2016 and 2019 which describes shrinking of databases. All the documents and forum questions are old and there is no proper guide on this topic. As per the old document we can shrink the database.

https://learn.microsoft.com/en-us/previous-versions/office/sharepoint-server-2010/cc262731(v=office.14)?redirectedfrom=MSDN#DBMaintenanceForSPS2010_ShrinkingDataFiles.

Microsoft 365 and Office SharePoint Server For business
{count} votes

2 answers

Sort by: Most helpful
  1. Matteo Zamori 91 Reputation points
    2022-02-15T10:58:12.277+00:00

    Hi @prabhat tunuguntla ,

    in addition on what suggested you may also have a look if you databases are set in SIMPLE or FULL recovery mode.

    Full recovery mode is normally set when you have your database in synch via Log-Shipping or Mirroring for High Availability.
    You may evaluate to switch the DB in simple recovery mode to gain space into LDF file.

    1 person found this answer helpful.
    0 comments No comments

  2. Allen Xu_MSFT 13,861 Reputation points
    2022-01-28T02:50:09.473+00:00

    Hi @prabhat tunuguntla ,

    Yes, you can shrink SharePoint Content database Data file. The link in your post is also applied to SharePoint Server 2016. Follow the guidelines in the article. DBCC SHRINKDATABASE shrinks the data and log files for a specific database. To shrink individual files, use DBCC SHRINKFILE. To shrink a database by using SQL Server 2016 Management Studio, expand Databases, right-click the database that you want to shrink, choose Tasks, Shrink, Files.
    169282-image.png

    ----------

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.