Solved

Best way to shrink SQL 2000 .LDF file

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

749 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