Solved

Best way to shrink SQL 2000 .LDF file

Posted on 2011-09-08
4
403 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:AnthonyJK
  • 2
  • 2
4 Comments
 
LVL 21

Expert Comment

by:mastoo
ID: 36503125
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.
0
 

Author Comment

by:AnthonyJK
ID: 36503327
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.
0
 
LVL 21

Accepted Solution

by:
mastoo earned 500 total points
ID: 36504088
I forget exactly the details in Sql 2000 but try in Enterprise Manager, right click the database, choose shrink database (it might be under a tasks or all tasks choice), turn on the option to return free space to the operating system, OK, and then wait.

I think that shrinks both the database and log, but if not then repeat the process but choose shrink files instead, and then select the log file to shrink.
0
 

Author Closing Comment

by:AnthonyJK
ID: 36504284
Thanks that worked perfect. I had to select the LDF file and went down under a gig. Thanks again.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now