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


Compact SQL Server using DBCC ShrinkDatabase question

Posted on 2009-03-30
Medium Priority
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!
Question by:badrhino
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
  • 2
LVL 31

Accepted Solution

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

Author Comment

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?
LVL 31

Assisted Solution

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

Author Comment

ID: 24039925

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
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 to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

704 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