Solved

Trim ldf

Posted on 2008-11-01
4
552 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 143

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

Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Record open by another user 6 73
Delete from table 6 48
How can I exclude some wording in a like statement? 39 78
Can Unique column have more than one Null? 8 60
There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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