Solved

Trim ldf

Posted on 2008-11-01
4
549 Views
Last Modified: 2013-11-05
I am doing FULL backups at 12:00 AM every night with the below script.  From 6:00 AM until 10:59:59 PM everyday I am running the lower most script every fifteen minutes.  Problems is that the database .ldf is growing and growing.  How do I trim it down prior/or during the Full backup?

BACKUP DATABASE [AdminDB] TO  DISK = N'\\clwfile03\system_backups$\CLWSQLPD01\AdminDB_FULL.Bak' WITH NOFORMAT, INIT,  NAME = N'AdminDB-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO

BACKUP LOG [AdminDB] TO DISK = N'\\clwfile03\system_backups$\CLWSQLPD01\AdminDB_Log.Trn' WITH RETAINDAYS = 1, NOFORMAT, NOINIT,
NAME = N'Pods-Transaction Log Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
0
Comment
Question by:jsyers
  • 2
4 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 22858927
a single transaction log backup will rarely be enough, and in case you don't do it more often, you could as well change the database recovery mode from full to simple (and not do any transaction log backups at all).

so, run the t-log backups every hour (or even more), and the ldf file should stop growing.
0
 
LVL 59

Assisted Solution

by:Kevin Cross
Kevin Cross earned 250 total points
ID: 22858945
If you recovery model is set to FULL then the log truncation should happen automatically after your BACkUP LoG statement.  Here are some reasons that may delay this from Microsoft:

http://msdn.microsoft.com/en-us/library/ms345414.aspx

Maybe what you are seeing is delayed truncation unless I am missing something in one of the options you have set.
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 22858958
I agree with Angel.  Thought you indicated you were running the transaction log backup every 15 minutes...which is why I thought it should work as you have it.

Maybe try increasing the time to 1HR as that is what I am using as well and have had no problems with it not truncating.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now