Showing posts with label SQL Server 2008. Show all posts
Showing posts with label SQL Server 2008. Show all posts

Monday, June 13, 2011

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.

JavaScript Related Questions & Answers

1.What is JavaScript? JavaScript is a client-side as well as server side scripting language that can be inserted into HTML pages an...