Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Log Backup Does Not Truncate the Log Expand / Collapse
Author
Message
Posted Wednesday, June 13, 2012 2:11 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Monday, December 1, 2014 7:41 AM
Points: 447, Visits: 580
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.



Post #1315474
Posted Wednesday, June 13, 2012 2:49 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:00 AM
Points: 40,610, Visits: 37,074
Please read through this: http://www.sqlservercentral.com/articles/Transaction+Log/72488/


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
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 #1315492
Posted Thursday, June 14, 2012 3:43 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, November 6, 2014 8:19 PM
Points: 121, Visits: 1,251
There are various reasons of transaction logs to grow too large like Uncommitted transactions, Extremely large transactions, Unreplicated transactions. Check this article it has all possible causes of “Why transaction log file get too large” and also have some solutions to overcome this issue:

http://www.recoverdatabase.blogspot.in/2012/04/what-to-do-if-sql-server-log-file.html


SQL Database Recovery Expert
Post #1315718
Posted Thursday, June 14, 2012 4:07 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:00 AM
Points: 40,610, Visits: 37,074
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 2008, MVP
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 #1315732
Posted Thursday, June 14, 2012 11:31 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Monday, December 1, 2014 7:41 AM
Points: 447, Visits: 580
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.


Post #1316101
Posted Thursday, June 14, 2012 11:43 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 10:48 AM
Points: 20,857, Visits: 32,877
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;





Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1316105
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse