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)
 Shrink Transaction Logs

Author  Topic 

grobi
Starting Member

2 Posts

Posted - 2004-10-21 : 20:10:23
I have tried shrinking 3 of our transaction logs becuase they are so big. I am using SQL 2000.

When I go into Shrink Database, I select the log to shrink the log.
The current size of one is 400MB, but the space used is 60MB. I have already backed up the transaction log. How do I reduce the current size to make it comparable to the actual space used? I have tried shrinking, I have tried dbcc shrinkfile, but the Current Size does not decrease. Please help!

Thanks!
GRobi

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-10-21 : 20:17:04
Sometimes you can't shrink it since the active portion is at the end of the log. You can fix this by doing mass inserts into a table. Just create a table. Then insert 10000 rows in it or so. Then run a transaction log backup, then dbcc shrinkfile.

Tara
Go to Top of Page

grobi
Starting Member

2 Posts

Posted - 2004-10-21 : 21:15:20
I'm fairly new to all this. Do I create the temp table in the same database, or a different database? If its on a different database, should I insert from the problem database or just insert dummy rows?

Thanks.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-10-21 : 21:18:50
It has to be in the same database. Just setup a fake table (not a #temp table) that'll go away after this is fixed. Insert dummy data into it.

Do you know you have free space in the tlog? How often are you backing up the tlog? Do you even need point in time recovery option?

Tara
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-10-22 : 01:49:28
There is an SProc by Andrew Zanevsky, called sp_force_shrink_log, which will help you, and it can be found here:

http://www.sqlserverfaq.com/content/kbase/KBArtViewer.aspx?ID=556

Kristen
Go to Top of Page
   

- Advertisement -