Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Problems shrinking a 37gig transaction log file?

Author  Topic 

thecoffeeguy
Yak Posting Veteran

98 Posts

Posted - 2007-01-23 : 23:31:10
Very odd.
I need to shrink the tlog file down to about 300-400megs.

However, when I try to shrink it down the size, down from 37gigs, it only goes down to about 34gigs.

Really confused on that right now.
Any idea why?

I jsut backed up the DB and tlog files. the tlogs were 100mb, DB was 17gb.

Wow...I thought this would be easier.

Do I need to do something like take the server offline or something?

Thanks.

TCG

thecoffeeguy
Yak Posting Veteran

98 Posts

Posted - 2007-01-23 : 23:51:25
Should I execute something like this, to try and recover the space?

“dump tran dbname with truncate_only”
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-01-23 : 23:56:05
you can refer to thread below for further info
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=56434


KH

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-01-24 : 00:13:36
DUMP TRAN?

Hasn't that been deprecated? I haven't used DUMP TRAN since SQL Server 6.5.

BACKUP LOG...

TCG,

What is your database recovery model set to? If not SIMPLE, are you performing regular tlog backups?

Tara Kizer
Go to Top of Page

thecoffeeguy
Yak Posting Veteran

98 Posts

Posted - 2007-01-24 : 11:59:20
quote:
Originally posted by tkizer
TCG,

What is your database recovery model set to? If not SIMPLE, are you performing regular tlog backups?

Tara Kizer



Right now, it is full. I had been working on getting a script ready to do regular tlog backups, every hour. As it stands now, we do one tlog backup a day. Long story really, but other things came up.

I was just surprised when it didn't shrink the file to the size I specified.

Go to Top of Page

thecoffeeguy
Yak Posting Veteran

98 Posts

Posted - 2007-01-24 : 12:24:31
would it be possible to just set the recovery mode to simple, do a full backup...would that clean up the 37gig tlog file?

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-01-24 : 12:52:03
You may have a "stuck" transaction at the 34GB point. Or that is the minimum size of something relevant - can;t think what though - the MODEL database perhaps? (not sure if that would do it though, and seems very unlikely ...)

My general approach would be:

USE MyDatabase
GO
BACKUP LOG MyDatabase WITH TRUNCATE_ONLY
GO
DBCC SHRINKFILE (MyDatabase_log, 1)
GO

(The name of your Log MyDatabase_log won't necessarily be to this style)

Kristen
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-01-24 : 14:53:31
see
http://www.nigelrivett.net/SQLAdmin/TransactionLogFileGrows_1.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-01-24 : 15:08:37
If you are only backing up the transaction log once a day, then you won't see much improvement in the file size with a shrink since most of it is probably in use.

Tara Kizer
Go to Top of Page
   

- Advertisement -