The official website of Bipul Raman

Resolving Space Issues on SharePoint Server caused due to SP Logs

No comments

Well, freeing space on server, cleaning up logs are usually admin tasks, but in case of Development servers, Mostly Developers are doing those tasks. Therefore, this particular article i have written from developers prospective.

Case & Solution:  
In case your SharePoint  Server is running out of Storage, Please check with Win Dir tool as shown in the above image. You can download that tool from below link: 
Download URL: https://windirstat.info/download.html

In most of the cases it is due to Logs files created by SharePoint.By inspecting WinDirStat tool, If you find any DATA folder under Program Files >> SQL Server >> … >> is occupying exceptionally high space,List out which DB logs are taking more spaces.
Run the below SQL scripts. Replace the WSS_Content_DB with Actual DB name which occupying higher space. Repeat the process for every single DB which is taking more space.

SQL Script: 
USE WSS_Content_DB
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE WSS_Content_DB
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (WSS_Content_DB_Log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE WSS_Content_DB
SET RECOVERY FULL;
GO

No comments :

Post a Comment