The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Shrinking an SQL Server 2000 Transaction Log

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Richard Jonas

Posts: 147
Nickname: rjonas
Registered: Nov, 2005

Richard Jonas is a .NET sofware developer living in the UK.
Shrinking an SQL Server 2000 Transaction Log Posted: Aug 11, 2006 6:35 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Richard Jonas.
Original Post: Shrinking an SQL Server 2000 Transaction Log
Feed Title: Richard Jonas
Feed URL: http://feeds.feedburner.com/blogspot/ouNA
Feed Description: Richard Jonas's blog about .NET, web development and agile methodologies.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Richard Jonas
Latest Posts From Richard Jonas

Advertisement
I have a database in which the transaction log grew to 19GB, taking up the entire disk space on the server it was on, and which could not be shrunk. Most of the things I found on the net didn't shrink this very much.

However, I found the following script here which worked well, reducing it from 19GB to 52 MB.

http://www.thescripts.com/forum/thread79839.html


use database_name
go
create table shrinkfile(
col1 int,
col2 char(2048)
)

dump tran database_name with no_log
dbcc shrinkfile(logical_name_of_log, 50, TRUNCATEONLY)
go


set nocount on
declare @i int
declare @limit int

select @i = 0
select @limit = 10000

while @i < @limit
begin
insert into shrinkfile values(@i, 'Shrink the log...')
select @i = @i + 1
end

drop table shrinkfile

Read: Shrinking an SQL Server 2000 Transaction Log

Topic: An Indian Community around Windows? Previous Topic   Next Topic Topic: Cool Tool: Aptana IDE

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use