How to shrink Huge SharePoint Content Database Log file?

After facing the problem of not being able to perform any action, like deleting, adding new list items, and after viewing WFE server application event viewer, i’ve figured out that my Back-end SQL server is out of space (the drive that holds the content databases and DB log files).

So after surfing microsoft’s website, i’ve found the best way to shrink the log file which was about 60 GB to be any size that i want (say 10 MB).

  1. open up SQL management studio.
  2. open a new query window.
  3. paste the following command lines:

USE WSS_Content_Web;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE WSS_Content_Web
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 10 MB.
DBCC SHRINKFILE (WSS_Content_Web_log, 10);
GO
-- Reset the database recovery model.
ALTER DATABASE WSS_Content_Web
SET RECOVERY FULL;
GO

 Execute (F5).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: