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
 General SQL Server Forums
 New to SQL Server Programming
 Shrink an LDF

Author  Topic 

yukon2010
Starting Member

2 Posts

Posted - 2006-05-22 : 10:05:27
I am trying to shrink a log file (.LDF), but it will not work. I am typing:
BACKUP LOG "Database1" WITH TRUNCATE_ONLY
dbcc shrinkfile ("Database1_log", 50)

The microsoft site says this should work:
http://support.microsoft.com/kb/272318/
...but I can't get the file to shrink, at all? I'm sure the SQL services need to be running. I am logged in as my Administrator / sa. What could I be missing? Trying to shrink it too much? (THANKS).

mr_mist
Grunnio

1870 Posts

Posted - 2006-05-22 : 10:07:12
Is the database in simple or full recovery mode?
If you're trying to shrink it "too much" then it would just shrink to as small as it can.

-------
Moo. :)
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2006-05-22 : 10:08:03
What was the original size?
have a look at
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

yukon2010
Starting Member

2 Posts

Posted - 2006-05-22 : 15:55:34
Thanks everyone, I've set the backup type to "simple", that is OK for my environment. I just need to be able to restore from the latest backup, don't need to restore to a point in time with this data.

Also, I've got the command to work - I think I just hadn't navigated to the right database in Query Analyzer. (Highlighting the folder in the left pane does not switch which db your in)

Go to Top of Page
   

- Advertisement -