Solved

Stil not clear on sql server Transaction LOG backup

Posted on 2008-06-12
7
181 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
[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
  • 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

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…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

729 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