November 13, 2012 at 7:16 am
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.
November 13, 2012 at 7:26 am
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
November 13, 2012 at 7:34 am
Managing Transaction Logs - http://qa.sqlservercentral.com/articles/Administration/64582/
Why is my transaction Log full - http://qa.sqlservercentral.com/articles/Transaction+Logs/72488/
Stairway to Transaction Log management - http://qa.sqlservercentral.com/stairway/73776/
Recovery Models - http://msdn.microsoft.com/en-us/library/ms189275.aspx
Accidental DBA Guide - Chapter 8 - http://qa.sqlservercentral.com/articles/books/76296/
SQL Server Backup & Restore - http://qa.sqlservercentral.com/articles/books/89519/
Comming Soon
SQL Server Transaction Log Management - http://qa.sqlservercentral.com/articles/books/94938/
November 15, 2012 at 3:15 am
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
November 15, 2012 at 3:17 am
miazaidi (11/15/2012)
User would have performed large DML operation, DELETE or UPDATEShrink 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?
November 15, 2012 at 4:03 am
miazaidi (11/15/2012)
User would have performed large DML operation, DELETE or UPDATEShrink 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
November 15, 2012 at 4:05 am
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
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply