Log Backup Does Not Truncate the Log

  • I have my database backed up nightly and the log is backed up every 30 minutes. However the size of the backup file is growing rapidly. Let say the log size is 10 GB. At the first log backup of the day it is only 5% of the log is used so the first log backup is around 50 MB. Around 2 - 3 PM the log file is 90% used and each time we do log backup the size of the log backup file increases by 9 GB. In the evening the log file is still 90% and the size of the log backup increases by 9 GB.

    I thought the log is truncated each time the log is backed up. How come the log is still 90% used after each time we backup the log?

    Thx.

  • Please read through this: http://www.sqlservercentral.com/articles/Transaction+Log/72488/

    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
  • This was removed by the editor as SPAM

  • That article is incorrect (or outdated) in several places, it's missing a couple of cause of log growth and it is missing a lot of detail about fixing the problems. Recommend rather the article I referenced above (yes, it's one I wrote)

    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
  • Thanks guys. The database is not for mirror, not replicated. There is no open transaction. I went over each possible cause shown in Gail's article but I cant find anything with my database. There are probably uncommitted trans but I don't know how to handle. The only things I can do is at night when the database is not in use I do a log backup, truncate the log (this is SQL 2005) and immediately backup the database. Truncating the logs is not the right choice but that will keep the next log backup files at manageable size. If I don't do this, I will have gigabytes backup files every 30 minutes next day.

  • When you t-log is 90% full (used), what does this query return:

    DECLARE @DatabaseName VARCHAR(50);

    SET @DatabaseName = 'VeryImportant' -- your database name here

    SELECT name, recovery_model_desc, log_reuse_wait_desc

    FROM sys.databases

    WHERE name = @DatabaseName;

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

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