Solved

Best way to shrink SQL 2000 .LDF file

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

743 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

11 Experts available now in Live!

Get 1:1 Help Now