all groups > sql server replication > december 2004 >
You're in the

sql server replication

group:

Log Shipping and Truncating Transaction Log


Log Shipping and Truncating Transaction Log Dazed and Confused
12/20/2004 6:41:10 AM
sql server replication:
When log shipping is setup, does it truncate the transaction log when it is
copied to the shared folder to be send to the standby server?

We currently have a prod database that generated about 30 Gig of transaction
logs a day. I have a log of 20 GB and I setup an alert that fires when the
log becomes 90 full to backup the log and truncate it. I don't really need
the backup of the log, but I do need to maintain the under 20 GB transaction
log, so if log shipping automatically truncates it then I don't have a
problem.

Log Shipping and Truncating Transaction Log Paul Ibison
12/20/2004 9:04:36 AM
Yes - the log is truncated as per usual. You could
initiate the log-shipping job as a result of your alert
then this would take care of it.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Re: Log Shipping and Truncating Transaction Log Hilary Cotter
12/22/2004 3:41:40 PM
It doesn't truncate the log. What it does is mark the virtual log files as
unused.

To see this run the following

create database DumpMe
GO
use DumpMe
go
Create table test(pk int primary key identity(1,1), charcol char(8000))
go
begin tran
declare @counter int
set @counter =1
while @counter < 100000
begin
insert into test (charcol) values(replicate('x',8000))
select @counter=@counter+1
end
commit tran
dbcc loginfo

--notice how all the status columns for all these vlf's have a value of 2.
this means the VLF has data in.

--now backup your transaction log
backup log [DumpMe] to disk='c:\dumpme.bak'

--run dbcc loginfo again. notice how this time the status column is all 0.
dbcc loginfo

If you have a 30 Gig database and a 20 Gig (or 90 Gig - not sure what you
mean from your post), your transaction log is probably not sized adequately.
You should dump it more frequently - perhaps every minute. Watch out for
http://support.microsoft.com/default.aspx?scid=kb;en-us;824430

I'm not saying frequent dumps will cause this problem - it might however.



"Dazed and Confused" <DazedandConfused@discussions.microsoft.com> wrote in
message news:FB07D21E-4830-4AD1-A4E7-D898E6D8EBC0@microsoft.com...
[quoted text, click to view]

Re: Log Shipping and Truncating Transaction Log Paul Ibison
12/23/2004 1:56:22 AM
Truncation is normally meant to mean a reduction in size
of the logical log file (as opposed to shrinking which
applies to the physical file), so marking the virtual log
files as unused is essentially truncation?
Rgds,
Paul Ibison
AddThis Social Bookmark Button