SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Size of Log file too big


Size of Log file too big

Author
Message
abdielmomo
abdielmomo
SSC-Enthusiastic
SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)

Group: General Forum Members
Points: 109 Visits: 76
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.
hs24
hs24
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1070 Visits: 374
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
anthony.green
anthony.green
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40847 Visits: 7187
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/



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
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


miazaidi
miazaidi
SSC Rookie
SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)

Group: General Forum Members
Points: 35 Visits: 53
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
anthony.green
anthony.green
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40847 Visits: 7187
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?



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
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


GilaMonster
GilaMonster
SSC Guru
SSC Guru (365K reputation)SSC Guru (365K reputation)SSC Guru (365K reputation)SSC Guru (365K reputation)SSC Guru (365K reputation)SSC Guru (365K reputation)SSC Guru (365K reputation)SSC Guru (365K reputation)

Group: General Forum Members
Points: 365237 Visits: 46927
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, MVP, M.Sc (Comp Sci)
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


GilaMonster
GilaMonster
SSC Guru
SSC Guru (365K reputation)SSC Guru (365K reputation)SSC Guru (365K reputation)SSC Guru (365K reputation)SSC Guru (365K reputation)SSC Guru (365K reputation)SSC Guru (365K reputation)SSC Guru (365K reputation)

Group: General Forum Members
Points: 365237 Visits: 46927
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, MVP, M.Sc (Comp Sci)
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


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search