CAN'T SHRINK MY SQL SERVER 2008 LOG FILES - 260GB CURRENTLY

Mikki Halpin

Total Post:23

Points:161
Posted by  Mikki Halpin
 803  View(s)
Ratings:
Rate this:
My database log files have grown to 260GB and I need to shrink them. I have tried numerous scripts such as:

DBCC SHRINKFILE ('HM_Log', 0)
As well as using the Shrink option in SQL Server Management Studio however the log file doesn't seem to shrink.

Has anyone got any suggestions?

The database is on my production server and actively used, I also have a maintenance plan setup to run all the relevant tasks including a daily transaction log backup and a weekly full backup which appears to be working fine.

I need to shrink it down so I can do a full backup + restore on my local development machine, however at the moment the log files is too large for my local drive.
  1. Mayank Tripathi

    Post:397

    Points:3117
    Re: Can't shrink my SQL Server 2008 Log files - 260GB currently

    You need to backup the log file, then it should be reduced in size automatically.

    See here: http://msdn.microsoft.com/en-us/library/ms178037.aspx

    In particular, this bit:

    Typically, truncation occurs automatically under the simple recovery model when database is backed up and under the full recovery model when the transaction log is backed up. However, truncation can be delayed by a number of factors. For more information, see http://msdn.microsoft.com/en-us/library/ms345414.aspx.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!