Shrink Trunsaction Logfile for SQL Server 2008R2

check the recovery mode of database

use master
SELECT NAME, recovery_model_desc FROM sys.databases;

change the recovery mode to simple

use master
alter database EDM_DEV set recovery simple;

locate the file name and the size of LOG file you want to shrink

use EDM_DEV
select name,size from sys.database_files;

the log is named “EDM_DEV_log”,shrink it to 1G

dbcc shrinkfile (N'EDM_DEV_log',1000)

check out the result of size of logfile,see if the size of logfile decreased

change the EDM database to full recovery mode

use matser
alter database EDM_DEV set recovery full;
SELECT NAME, recovery_model_desc FROM sys.databases;

cleanTrunsactionLogfile
–EOF–