Technical Article

truncating the log

,

backup log with truncate only doesn't shrink the file. Actually truncating log needs transaction to truncate. A simple way to reduce the log file size to 1KB.

dbcc shrinkfile (2, notruncate)
dbcc shrinkfile (2, truncateonly)
create table t1 (char1 char(4000))
go
declare @i int
select @i=0

while(@i < 100)
begin
insert into t1 values ('a')
select @i = @i +1
end
truncate table t1
backup log pubs with truncate_only

drop table t1

go

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating