Posts

Showing posts with the label Truncate and shrink Transaction Log file in SQL Server 2008

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 .