Shrink SharePoint Config DB log file

Issue:

We all are aware that SharePoint have default DB i.e. configDB and in SQL database every database have a log file to log the operations / transactions. Due to number of users and transactions log file grow much faster than transactional data file.

Due to this server team start complaining and asking me to move or delete this log file.

Error Message:

Low Disc Space

Solution:

To resolve this issue we can fix by using two methods-

  • Using SQL Server management Studio
  • Using SQL Script

SQL Server management Studio

Log on the backend server (SharePoint Database Server) by using admin account to perform task for database.

  • Open the SQL Server management studio and connect sharepoint DB server instance
  • Check the default properties of sharepoint_config database and log files
Auto-growth

Right click the SharePoint_config database click properties and it will open the database properties dialog box and select

  • Options
  • Recovery model full to simple
  • And click ok
Recovery Mode

Right-click on the sharepoint_config database click Task-> Shrink-> Files

Shrink files
Shrink Process

Note: If the log file is large in size, it might take some time to shrink it, resulting in the processing taking longer time.

Once shrink process completes, change the recovery model back to full from simple recovery model.

Full Recovery Mode

SQL commands to Shrink log file in Database

use SharePoint_Config
alter database SharePoint_Config set recovery simple
go
checkpoint
go
alter database SharePoint_Config set recovery full
go
dbcc shrinkfile (N’SharePoint_Config_log’ , 2)
go

DB Shrink query

Leave a comment