Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am a .net developer and not a expert in database. I have a application running with SQL server 2008. Yesterday there was issue with a certain query getting executed in infinite loop and which caused DB size to grow from 500 MB to 380 GB. The log file itself was 300 GB and mdf file 80 GB. Today I stopped the query and truncated the log file to 12 MB. Then I figured out tables which were grown and truncated those tables as well but still my db size is 67 GB! I ran query to determine the size of all tables http://stackoverflow.com/a/7892349/287100

But the total size of all tables was less than 100 MB. I want to know why the db size is huge and how can I reduce it to normal.

Thanks.

share|improve this question

migrated from stackoverflow.com Jan 6 '13 at 3:13

This question came from our site for professional and enthusiast programmers.

1  
The data file won't shrink automatically to return the freed up space (except if auto shrink is on - which it shouldn't be). You would need to shrink the file manually. –  Martin Smith Aug 1 '12 at 10:32

1 Answer 1

up vote 1 down vote accepted

Are you using a simple recovery mode? if you do not need the full mode this could help.

How big is the Log file now? maby it got huge again according to a full recovery mode, try to shrink it again if you change to the simple recovery mode and check it then.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.