Solved

DATABASE SIZE SHRINKING AND LOG FILE QUESTION

Posted on 2002-03-05
3
316 Views
Last Modified: 2012-06-27
Hello all.  I have a database that is approx 625 Meg large currently.  I am not sure why it is getting so large it was only approx 200Meg about 2 weeks ago.  What I did was I dumped the log file and then did a shrink it went from 701 Meg to 625 Meg.  One of the tables is very large it has 1.3 million records in it.  I know that might be why it is so big.  But I was wondering it says in the properties of the database and on the data files tab it says space allocated 624 Meg.  Is there any checks I can do to see actually how big the database should be like by the records etc?  Any other way to shrink database more?
0
Comment
Question by:InvisibleMan
  • 2
3 Comments
 

Accepted Solution

by:
baulrich earned 15 total points
ID: 7752598
Invisible,

each SQL database is made up of a .mdf file and a .ldf file.  These are by default in C:\Program Files\Microsoft SQL Server\MSSQL\Data\  You can go here and view the size of your 2 database files:  dbname.mdf and dbname.ldf  usually.  The .mdf file cannot be reduced in size, as it actually contains the info in your db.  The log file, under the right conditions should be able to be reduced to about only 1 MB.  So if your dbname.ldf file is considerably bigger than that, you can shrink the size occupied by the entire DB.  To do that you can use Enterprise Manager (Start->Program Files->Microsoft SQL Sever->Enterprise Mgr).  Browse to the server and find your database name under the databases folder.  Right click on the name of your DB and go to properties.  Now...go thru the tabs(i think it the 3rd or 4th over) on this dialog box and find the drop-down box for the logging mode.  This can be set to Full, Simple, and maybe one or 2 other options.  Be sure to choose Simple here.  Now you can go back to your DB->All Tasks->Shrink Database.  It should get your .ldf file down to about 1 MB.  Now, you may want to go back and change the logging mode back to Full if you are scared of not recovering if something goes wrong.  Hope all that helps.

- baulrich
0
 

Expert Comment

by:SpideyMod
ID: 8004169
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

I am in the process of cleaning up the questions for this member as this member has failed to take care of their opened questions
Experts, please leave your recommendations within the next 3 days.
Without recommendations, I intend to come back here on 2/26/2003 and:
Force Accept answer by baulrich


InvisibleMan,
You have 16 opened questions and have been asked to take care of them previously.  If you wish to keep your account in good standing, please take care of these questions prior to 02/26/2003.  
Failing this, your account will be reviewed by a site administrator at that point.  I am posting this in ALL 16 opened questions and have submitted a cleanup request in community support.

http://www.experts-exchange.com/Applications/MS_Office/Q_20439569.html
http://www.experts-exchange.com/Databases/MS_Access/Q_20453889.html
http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20388128.html
http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20343921.html
http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20273575.html
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20480517.html
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20475331.html
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20409250.html
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20336887.html
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20327829.html
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20324132.html
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20390261.html
http://www.experts-exchange.com/Web/Graphics/Adobe_Acrobat/Q_20403544.html
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20519637.html
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20457825.html
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20428768.html


SpideyMod
Community Support Moderator @Experts Exchange

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
0
 

Expert Comment

by:SpideyMod
ID: 8059011
All C grades issued are being changed to A grades.  InvisibleMan, if you have issue with this, please post a comment in Community Support and I will have another moderator or an admin look at my actions.  If the answer didn't work, you should have opted to request a refund instead of accepting an answer which any one of us would have gladly assisted with.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSRS - Date Report Options 2 26
SQL Server / Update DB? 22 36
SSMS Opening Mode 9 18
SQL 2012 clustering 9 9
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Viewers will learn how the fundamental information of how to create a table.
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.

790 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