question

dolleyes avatar image
dolleyes asked

How can I reduce the size of a log file?

I have a 108GB log file that I'm trying to reduce in size. i have backed it up along with the database and also tried shrinking it with no luck. Any help would be greatly apprecaited.
transaction-log
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
This site runs on votes. Please mark all helpful answers by clicking on the thumbs up. If any one answer lead to a solution, please indicate this by clicking on the check mark next to that answer.
0 Likes 0 ·
Tim avatar image
Tim answered
Pretty simple, but just shrinking the log won't fix your issue. You probably have the database in full recovery model and are making database backups but not backing up your log. To get the file under control you should switch to simple recovery, then back to full to truncate the log then you can shrink the file. To keep this from happening you should either schedule regular log backups if you need them for a point in time recovery. If you don't need a point in time restore then just switch to simple and leave it there and then shrink the file. You can read about it on my [blog]( http://timradney.com/2011/08/31/shrinking-transaction-logs/)
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

dolleyes avatar image dolleyes commented ·
Thank you Steve. Yes, I had been doing both backups.
0 Likes 0 ·
Tim avatar image Tim commented ·
when you run dbcc sqlperf(logspace) what percentage of the log is full?
0 Likes 0 ·
dolleyes avatar image dolleyes commented ·
Thank you for the response. There were no open transactions and the log percentage is now normal.
0 Likes 0 ·
ThomasRushton avatar image
ThomasRushton answered
Is this database being used for replication or mirroring? If so, then check that the mirror / replication systems are all up & running properly. Also, have a look at the output of [link text][1]`DBCC OPENTRAN`, as it's possible you have some other long-running transaction preventing log reuse. [1]: http://technet.microsoft.com/en-us/library/ms182792.aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.