How to shrink transaction log files for SharePoint

August 9, 2011 — 1 Comment

I found a great post from : SharePoint: How to shrink transaction log file and
I was able to follow the instruction and successfully shrink transaction logs for SharePoint database without any problem. 

Here is the instruction to shrink transaction logs  files for SharePoint

  1. Change the database recovery model to SIMPLE using the next command:
    • ALTER DATABASE <Your Database Name> SET RECOVERY SIMPLE;

      shrink_transaction_logs_for_sharepoint

  2. Shrink the database or transaction log file using Microsoft SQL Server Management Studio:
    Right click on the database which you  altered to recovery simple and go to Task | Shrink | Database  It will take some time depend on on the size of database

    Shrink Transaction Log for SharePoint
    Or use the following command to shrink the transaction log file, for example, to 5 MB:

    • DBCC SHRINKFILE (<Your Database Name>_Log, 5);
  3. Set back the database recovery model to FULL using the next command:
    • ALTER DATABASE <Your Database Name> SET RECOVERY FULL;

      shrink_transaction_logs_for_sharepoint_recovery_full

If it’s not production database, you, in principle, can skip step 3 leaving the database recovery model in SIMPLE. Transaction log in this case will not grow. But note that some people complain that it can cause some problems while attempting to delete SiteCollection from SharePoint Central Administration. I’ve never been faced with such issue, but just in case keep FULL recovery model.

Source: SharePoint: How to shrink transaction log file

One response to How to shrink transaction log files for SharePoint

  1. 

    This was very helpful

Leave a Reply

Please log in using one of these methods to post your comment:

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