Advertisements

Unable to shrink Sharepoint_Config_Log file in Sharepoint 2010

Is your Sharepoint_Config_Log file reaching enormous GB size of data and nearing your full drive space utilization?

Shrinking a Log File in your SQL Database may seem very straightforward when accessing SQL Server Management Studio

You may have already tried the below and still not seen any change in the file size

ShrinkLogFile

If the above scenario is true, it is most likely that you have set your DB in Full Recovery Mode and hence will not allow you to shrink the log file

Please note that in my illustration I have made an assumption that the default dbname Sharepoint_Config has been changed; if changed please make revisions to the script accordingly

To confirm this further, run the shrink operating using the SQL Query.

From the SQL Server Management Studio

  • Click New Query and type below command
  • DBCC SHRINKFILE (Sharepoint_Config_LOG);
  • Execute the command
  • Click the Messages tab at the bottom and take note of the error

Your are most likely to get the below error

“Cannot shrink log file 2 because the logical log file located at the end of the file is in use”

In SQL Server Management Studio; run below commands

use master;
alter database Sharepoint_Config set recovery simple;
  • DBCC SHRINKFILE (Sharepoint_Config_LOG);

This will shrink the log file to its default size.

Advertisements

About Sunil Padmanabhan

An Indian based out of Dubai who started traveling from 2011 and pretty much caught the travel bug. Every year presents itself as an opportunity to visit and explore a new place.

Posted on March 19, 2014, in Sharepoint, Sharepoint 2010 and tagged , . Bookmark the permalink. Leave a comment.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: