Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Size of Log file too big Expand / Collapse
Author
Message
Posted Tuesday, November 13, 2012 7:16 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, December 31, 2013 3:28 AM
Points: 13, Visits: 43
I have discovered yesterday that the size of the log file on my database has increased to 55 Gb while the datafile is 8 Gb. The users are complaining that applications using this database are very slow. The server is sql server 2008 R2.
What can i quickly do to reduce the size of the log file? The free space disk on my server is 35 MB!
Thanks in advance.
Post #1384077
Posted Tuesday, November 13, 2012 7:26 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Friday, June 27, 2014 2:49 AM
Points: 794, Visits: 355
What you need to ensure is that you have a suitable back-up policy in place.

If the Database is in Full recovery then you need to ensure that you run regular transaction log backups and a daily full backup.

If in simple recovery then you shall need to ensure that you run a full backup at least daily depending on your RPO and RTO.

can you confirm what recovery model is being used by the database?

If it is in full recovery ensure that a full backup has been taken and then run a transaction log backup. After this you may be able to run DBCC Shrinkfile against the
DB Log file



Post #1384087
Posted Tuesday, November 13, 2012 7:34 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:35 AM
Points: 5,143, Visits: 4,944
Managing Transaction Logs - http://www.sqlservercentral.com/articles/Administration/64582/
Why is my transaction Log full - http://www.sqlservercentral.com/articles/Transaction+Logs/72488/
Stairway to Transaction Log management - http://www.sqlservercentral.com/stairway/73776/
Recovery Models - http://msdn.microsoft.com/en-us/library/ms189275.aspx
Accidental DBA Guide - Chapter 8 - http://www.sqlservercentral.com/articles/books/76296/
SQL Server Backup & Restore - http://www.sqlservercentral.com/articles/books/89519/

Comming Soon
SQL Server Transaction Log Management - http://www.sqlservercentral.com/articles/books/94938/




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1384095
Posted Thursday, November 15, 2012 3:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, June 29, 2014 2:25 AM
Points: 1, Visits: 47
User would have performed large DML operation, DELETE or UPDATE

Shrink you database, it will reduce the size of your .ldf as well as .mdf

USE [DATABASE NAME]
GO
DBCC SHRINKDATABASE(N'DATABASE NAME' )
GO
Post #1385032
Posted Thursday, November 15, 2012 3:17 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:35 AM
Points: 5,143, Visits: 4,944
miazaidi (11/15/2012)
User would have performed large DML operation, DELETE or UPDATE

Shrink you database, it will reduce the size of your .ldf as well as .mdf

USE [DATABASE NAME]
GO
DBCC SHRINKDATABASE(N'DATABASE NAME' )
GO


Why shrink database when the OP said it was the log?

Also you do know the implications of shrinking a database?




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1385035
Posted Thursday, November 15, 2012 4:03 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 12:11 PM
Points: 42,470, Visits: 35,541
miazaidi (11/15/2012)
User would have performed large DML operation, DELETE or UPDATE

Shrink you database, it will reduce the size of your .ldf as well as .mdf

USE [DATABASE NAME]
GO
DBCC SHRINKDATABASE(N'DATABASE NAME' )
GO


No, don't do that. It'll fragment the indexes, cause performance problems and probably won't solve the large log problem



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1385070
Posted Thursday, November 15, 2012 4:05 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 12:11 PM
Points: 42,470, Visits: 35,541
Most likely full recovery model and no log backups. See the first article that Anthony posted.

One other point, a large log will no cause poor performance. Shrinking a log will not improve performance.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1385072
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse