Solved

DATABASE SIZE SHRINKING AND LOG FILE QUESTION

Posted on 2002-03-05
3
288 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Backup skipping a few tables 7 28
Getting certain data from a string 1 26
Caste datetime 2 24
add 1 to a field for 100 rows 11 22
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…
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 …
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
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…

760 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

22 Experts available now in Live!

Get 1:1 Help Now