September 25, 2015 at 8:36 am
I have a database:
mdf: 135 GB
ldf: 768 GB
We do daily full backups but the log file is continuing to grow.
I would like to do the following:
Checkpoint;
full backup;
set recovery model to simple;
set log size to 25 GB (approx 20%)
set recovery model to full
Does anyone see a problem with this?
Thanks,
Mike
September 25, 2015 at 8:46 am
Are you doing transaction log backups? How often? There's no need to change to simple mode and back again - just back up the log and shrink it to the size it's going to need to be. But don't bother shrinking it if you know or suspect it's only going to grow again - that's a waste of server resources and is likely to cause physical fragmentation on disk.
John
September 25, 2015 at 8:47 am
So you're not doing log backups?
Either you change your recovery mode to simple or you start taking log backups and managing the transaction log correctly.
Changing the recovery model to simple and then to full makes absolutely no sense.
More information: http://www.sqlservercentral.com/articles/Stairway+Series/73779/
September 25, 2015 at 8:50 am
If your Recovery model is set to FULL and you are taking only Full backups, then the log file will grow. A full backup won't truncate the T-log. So, if you want to leave your database in FULL Recovery model, you need to schedule regular T-Log backups as well besides daily Full backups. Or you can leave your database in SIMPLE recovery model if you don't want point in time recovery(I wouldn't do that on a production database).
September 25, 2015 at 9:07 am
Yes, we are doing t-log backups every 24 min.
Also, I don't understand something about logging... doesn't a checkpoint command clear all dirty log issues? What is in a transaction log after a checkpoint that isn't in the actual mdf file?
Thanks,
Mike
September 25, 2015 at 9:36 am
mike 57299 (9/25/2015)
Also, I don't understand something about logging... doesn't a checkpoint command clear all dirty log issues?
No. A checkpoint writes all dirty database pages to disk and, in simple recovery only, truncates the log
What is in a transaction log after a checkpoint that isn't in the actual mdf file?
Meaningless question, since the log isn't a 'holding spot' for changes.
Take a read through this: http://www.sqlservercentral.com/articles/books/94938/
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
September 25, 2015 at 11:23 am
For additional info on backups I always liked this article from Paul
https://technet.microsoft.com/en-us/magazine/2009.07.sqlbackup.aspx
September 25, 2015 at 11:39 am
Thank you all.
I did a DBCC SQLPERF and found out that the log is only using .99% of the 700+ GB file. Later tonight, I will do a shrink file on it.
Mike
September 25, 2015 at 11:44 am
Don't shrink it to zero. Shrink it to around half of the size of the msf, and monitor the file growth and usage.
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
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply