Truncate and shrink Transaction Log file in SQL Server 2008

In SQL Server this process have been changed. In 2008, just change the recovery model to simple and then use DBCC Shrinkfile command.


Now follow these steps to shrink database file.
  • Truncate the log by changing the database recovery model to SIMPLE
           ALTER DATABASE [<Your Database Name>] 
           SET RECOVERY SIMPLE;
           GO
  • Shrink the truncated log file to 5 MB
           DBCC SHRINKFILE ([<Your Database Name>_Log], 5);
           GO
  • Reset the database recovery model.
          ALTER DATABASE [<Your Database Name>]
          SET RECOVERY FULL;
          GO
NOTE: Don't leave your database Recovery in "SIMPLE" mode. This will cause some problems when u try to delete Site Collection from SharePoint Central Administration. Always keep it in "FULL" mode.

Comments

Anonymous said…
Good Article on shrinking dbs of SharePoint 2010/
Anonymous said…
great post! successfully truncated sharepoint logs.
Anonymous said…
Really nice post.

Are you sure about the issue with leaving in simple mode? Here is the only place I could find that warning and I want to keep my database in simple mode.

Thanks
Suresh Pydi said…
Thanks, Thanks a lot............. Can you please explain wht is happening here?
Suresh Pydi said…
Thanks....Thanks a lot....
Suresh Pydi said…
Thanks... Great post to shrink DB in Sharepoint 2010...

Popular Posts

SharePoint Interview Questions and Answers

Download Infopath Form Templates

How to get current logged user information using JavaScript ?

Steps to set Form based authentication (FBA) for SharePoint 2010

SharePoint Interview Questions and Answers II

Get List Items - JavaScript

Change Language for current user with JSOM in SharePoint Online

Cross Site List Rollup Web Part for SharePoint 2010

Hide Recently Modified Items

SharePoint 2010 CSS Chart