Solved

Best way to shrink SQL 2000 .LDF file

Posted on 2011-09-08
4
419 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

860 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