Showing posts with label truncate. Show all posts
Showing posts with label truncate. Show all posts

Wednesday, March 7, 2012

Log Shipping and Truncating Transaction Log

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.
Thanks in advance for any replys.
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...b;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...
> 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.
> Thanks in advance for any replys.
|||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

log shipping and truncate table

As a noob, I'm wondering, how does sql server 2005 react to a truncate table
on a table within a database which is subject to log shipping?
Thanks.
CRCR wrote:
> As a noob, I'm wondering, how does sql server 2005 react to a truncate tab
le
> on a table within a database which is subject to log shipping?
> Thanks.
> CR
>
http://support.microsoft.com/kb/272093
Tracy McKibben
MCDBA
http://www.realsqlguy.com

log shipping and truncate table

As a noob, I'm wondering, how does sql server 2005 react to a truncate table
on a table within a database which is subject to log shipping?
Thanks.
CR
CR wrote:
> As a noob, I'm wondering, how does sql server 2005 react to a truncate table
> on a table within a database which is subject to log shipping?
> Thanks.
> CR
>
http://support.microsoft.com/kb/272093
Tracy McKibben
MCDBA
http://www.realsqlguy.com

log shipping and truncate table

As a noob, I'm wondering, how does sql server 2005 react to a truncate table
on a table within a database which is subject to log shipping?
Thanks.
CRCR wrote:
> As a noob, I'm wondering, how does sql server 2005 react to a truncate table
> on a table within a database which is subject to log shipping?
> Thanks.
> CR
>
http://support.microsoft.com/kb/272093
Tracy McKibben
MCDBA
http://www.realsqlguy.com

Friday, February 24, 2012

log shipping and growing of trans log on backup server

hi all,
we do log shipping to a backup server. Log on the backup server is
growing. It seems ok to truncate log once/day.
Is it!the LOG is growing on your backup server because it must be growing on your
primary server too, you will need backup the log on the primary server first
and then restore the latest log to the backup for the log file to truncate.
--
-- cranfield, DBA
"Zarko Jovanovic" wrote:
> hi all,
> we do log shipping to a backup server. Log on the backup server is
> growing. It seems ok to truncate log once/day.
> Is it!
>