Link to home
Start Free TrialLog in
Avatar of AnthonyJK
AnthonyJK

asked on

Best way to shrink SQL 2000 .LDF file

Hello,
I am searching on the best way to shrink this LDF file in my Attendance database. I have found various ways and tried a few that didnt work. Here are the details....

Attendance.mdf          --> 1.4GB
Attendnace_log.LDF   --> 30.4GB

I am a "Beginner" at SQL so i know very little. I have seen a few options i was wondering about.

* SQL Server Enterprise Manager --> Databases --> right click attendance and go to propertiers. Then on the Transaction Log tab there is a checkbox for "Automatically grow file". This is checked and along with "File Growth by percent 10" and then also Maximum file size is set to Unrestricted file growth. Should i change this and if so to what?

* Other option i have been seeing is the same properties box but on the Options tab there is a "Recovery Model" that is set to Full. Should i change this to simple? I have read this will shrink it also.

I would just like to get the log file down to the same as the MDF file or pretty close anyways if at all possible. Thanks for any help on this.
Avatar of mastoo
mastoo
Flag of United States of America image

You could switch to simple recovery model if you only need to be able to recover to the last full backup.

Otherwise stay in full but make sure you are running regular log backups.

Then right click the database in SSMS and shrink it.  Going forward just let it stabilize at some reasonable size.
Avatar of AnthonyJK
AnthonyJK

ASKER

Thanks. I switched it to simple recovery because last full backup will be just fine but what do i do next. I did a full backup after i changed the .LDF file stayed at the same size. What is the correct steps i should be doing?

Thanks again for help.
ASKER CERTIFIED SOLUTION
Avatar of mastoo
mastoo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks that worked perfect. I had to select the LDF file and went down under a gig. Thanks again.