I have a problem that is my log file in SQL Server 2008 is grown to 40Gb and I wanted to shrink it. The query I am using is
ALTER DATABASE DatabaseName SET RECOVERY SIMPLE
use DatabaseName
GO
CHECKPOINT
GO
DBCC SHRINKFILE(transactionloglogicalfilename,TRUNCATEONLY)
GO
ALTER DATABASE DatabaseName SET RECOVERY FULL
is not shrinking the log file at more level and also the shrink log file is expanding immediately in short time only.
So where is the problem ?
I wanted to shrink the log file upto 1GB and my database size is 16GB
I have SQL Server 2008 R2
Please someone help me