Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Trim ldf

Posted on 2008-11-01
4
Medium Priority
?
556 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
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1000 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 60

Assisted Solution

by:Kevin Cross
Kevin Cross earned 1000 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 60

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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Integration Management Part 2
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

772 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