Solved

Stil not clear on sql server Transaction LOG backup

Posted on 2008-06-12
7
166 Views
Last Modified: 2010-03-19
I'm not a DBA but we dont have a DBA here. I think i asked this question maybe 2 yrs ago but i'm still not clear on the procedure for backing up LOG transaction in production environment...

If I remember correctly, 2 jobs ago, the "DBA"...backed up the log every 15 mins and trucated it. So every 15 mins, it was backed up, trucated,.,,backed up, truncated.

Our log file is growing here... not yet very big...1 GB so far....But what is the correct policy/method of do this??
Here it says to truncate it:

http://support.microsoft.com/kb/873235
0
Comment
Question by:Camillia
  • 4
  • 3
7 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 500 total points
ID: 21770386
Truncating it is NOT necessary.  

When you do a log backup, youre removing the inactive poritions of the log....of if you're in full recovery mode, you should be doing log backups....every 15-20 min is a good place to start...but it really depends on the requirements.  You really won't need to shrink the log, so doing your trans log backups every so often will keep your log from growing out of control.  Does that make sense?

BTW..truncating the log makes is so that you can't restore to a point in time...which you'll want to be able to do since you're in full recovery mode already.
0
 
LVL 7

Author Comment

by:Camillia
ID: 21770456
I think I've got it finally..only took maybe 2 yrs :)

I've read that Db should be in full mode in production...this is to be able to retrieve lost data..correct?

If I actually want to shrink the size of the log, i can use shrinkfile ..correct? ( i want to do this in our test environment)
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 21770471
If you think you really need to shrink it,then use DBCC SHRINKFILE....do make sure you test it first.

If will help you recover to a point in time...so, if you want to recover to a point in time, you restore your last full backup, last differential backup (if you have one), and any trans logs in order up to the time you want to restore....
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 7

Author Comment

by:Camillia
ID: 21770558
i think i dont understand the second paragraph...

if I backup the log every 15 mins..suppose i start at 1 PM.
At 1:00, i have a backup
At 1:15, i have a log backup
At 1:30 , i have a log backup
At 1:45...something happens and i want to recover. I should restore the backup from 1:30..correct?

-- so backup the transaction log but what is that last differential backup??
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 21770593
if you can perform a tail log backup (final tlog backup...the 1:45 backup) then do so...otherwise, you would do this:

restore your full backup from 1
restore your tlog backups from 1:15 and 1:30.  If the 1:30 is the last tlog bkup you have, then you're done.  If you have the tlog backup from 1:45, you can restore up to the point in time of the error....say it happend at 1:40, you can restore up to 1:39 or so.
0
 
LVL 7

Author Comment

by:Camillia
ID: 21770642
One last question....you say it not needed to shrink the tlog
that link above has:
"To recover from a situation where the transaction logs grow to an unacceptable limit, you must reduce the size of the transaction logs. To do this, you must truncate the inactive transactions in your transaction log and shrink the transaction log file."

What if I shrink , but still have the tlogs...can I still recover the DB by using the tlogs? I would think the answer is yes...
0
 
LVL 7

Author Comment

by:Camillia
ID: 21770773
i do get it. Amazing. Thanks.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 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

16 Experts available now in Live!

Get 1:1 Help Now