Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DATABASE SIZE SHRINKING AND LOG FILE QUESTION

Posted on 2002-03-05
3
Medium Priority
?
339 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Accepted Solution

by:
baulrich earned 60 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
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.
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

715 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