Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Compact SQL Server using DBCC ShrinkDatabase question

Posted on 2009-03-30
4
Medium Priority
?
552 Views
Last Modified: 2012-06-22
I have a database that has multiple tables with each table having large amounts of data being inserted into it periodically, and very rarely do we ever delete a record in these tables.
This database has grown quite large, andI have noticed that all of my tables have large amounts of reserved and unallocated disk space.  For instance, one table has1.7 gigs of reserved space, 478 mb of data and 1.14 gigs of unallocated space.  
My question is would DBCC ShrinkDataBase (DatabaseName, TruncateOnly) be the best option to shrink the reserved and unallocated disk space?  If not, what would you recomend?  Thanks in advance for your respones!
0
Comment
Question by:badrhino
  • 2
  • 2
4 Comments
 
LVL 31

Accepted Solution

by:
RiteshShah earned 2000 total points
ID: 24020170
yes, i would prefer to go for dbcc shrink. have a look at following link.

http://www.sqlhub.com/2008/05/sql-server-truncate-transaction-log.html
0
 
LVL 1

Author Comment

by:badrhino
ID: 24020273
Thanks for the response.  I'm planning on running this command tonight in case it takes a lot of resources.  Is this approperiate, or do I not need to worry about the server locking up when running it on a 7.5 gig database?
0
 
LVL 31

Assisted Solution

by:RiteshShah
RiteshShah earned 2000 total points
ID: 24025111
it is good if you run it in low traffic time.
0
 
LVL 1

Author Comment

by:badrhino
ID: 24039925
RiteshShah:
Thanks!!!
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how the fundamental information of how to create a table.

926 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