Even though you have run DBCC SHRINKFILE and similar steps you may find that the log file will not shrink.
Why won't it shrink?
First, make sure you've backed up the log file. SQL Server doesn't want to truncate a log file that's not been backed up, and this is the behaviour we would want. So, the first step is to backup the log file, even if you just toss the backup. (thanks to jnicho02)
Run the command [tt]DBCC LOGINFO[/tt] against the desired database and look for entries with the Status=2. A Status of 2 indicates that this portion of the log is active. SQL Server cannot truncate a log before this active portion. If the active portion is at or near the end of the log file, this will prevent the log from being shrunk.
How can I make it shrink?
As with all things, the natural way is best. Once you've backed up the transaction log, future transactions will eventually force the active portion to wrap around to the beginning of the file. When that happens, the log will be shrunk.
I can't wait - I want it to shrink now!
If you must shrink the log, and you don't have a production database (or point-in-time recovery is not important to you), this site contains the steps needed to force it to shrink:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.