June 13, 2012 at 2:11 pm
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.
June 13, 2012 at 2:49 pm
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
June 14, 2012 at 3:43 am
This was removed by the editor as SPAM
June 14, 2012 at 4:07 am
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
June 14, 2012 at 11:31 am
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.
June 14, 2012 at 11:43 am
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