Size of Log file too big

  • 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.

  • 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

  • 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/

  • 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

  • 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?

  • 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
  • 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

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply