Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Log Backups Failed to Truncate Log Expand / Collapse
Posted Wednesday, March 20, 2013 1:23 AM

Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Sunday, July 24, 2016 7:01 PM
Points: 516, Visits: 1,803
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?


Post #1433024
Posted Wednesday, March 20, 2013 1:50 AM



Group: General Forum Members
Last Login: Saturday, December 3, 2016 5:18 AM
Points: 45,619, Visits: 44,147
Please read through this:

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

Post #1433039
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse