Log Backups Failed to Truncate Log

  • I have a full recovery database used for holding logging information, typically Name, Type, Time and some other values. Each record is its own transaction and the db gets around 40 million inserts per month. The database is mirrored.

    We like to keep only a few months logs in the db and have a nightly job that, for hardware reasons, deletes batches of 450 records with a 2 second waitfor during a 3 hour graveyard shift window. The job will terminate if a) it reaches the monthly limit; b) it hits the end-of-shift hour; or c) the 12 GB log file gets to less than a preset amount of free space. The following step of the job performs a log backup. This job has been running for months. There are also 4 other periodic log backups during the day.

    The problem: about a week ago whilst I was "other duties as assigned" the log filled up - presumably by the batch job though I don't know for sure - and was not truncated by an log backup for 3 days, growing a further 6GB from logging inserts. The batch job ceased to execute as the log file was already full. This state appears to have been ended by a scheduled reboot of the server which flipped things over to the mirror.

    The question: why did around 15 log backups never truncate the log file? At first I thought "open transactions don't get truncated" but at either 1 or 450 rows per transaction, 18GB is *a lot* of open transactions. But what else is there?

    Fal.

  • 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

Viewing 2 posts - 1 through 1 (of 1 total)

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