Solved

SQL database  reducing database size

Posted on 2014-09-10
3
61 Views
Last Modified: 2015-03-11
We have a SQL database that is about to suck up the whole hard drive space.  We have identified tables we can remove and will do that.  The database is 180 gig.  My question:  after we delete tables, how best to recover disk space.  I have read about shrink and there seems to be some major pitfalls.  If I reduce DB by 40% how long will shrink take?  will reindexing help with fragmentation?  I need space for the transaction log file.  Please assist.

Thank you,
0
Comment
Question by:BUCKBERG
[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
3 Comments
 
LVL 23

Accepted Solution

by:
Thomas Grassi earned 500 total points
ID: 40315089
1. Backup your database Full and transaction log files
2. create a new database same tables
3. Export the original database
4. Import into new database.
5. detach original database
6. delete the database files
7. rename new database to the original database name

Try shrink first to see what happens.

Always make a backup of the database and transaction log files before doing any of the above.
0
 
LVL 80

Expert Comment

by:David Johnson, CD, MVP
ID: 40315116
backup regularly to reduce the log files.. deleting tables is not really an alternative .. Disk space is cheap these days give it more space.
0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 40315308
Which table(s) are the big ones?

Can you compress any large tables?  [Only Enterprise Edition (or Developer)]

Can you archive some data to another location?

Are the large table(s) on different filegroups?

Maybe?: ?Can you move any tables, such as log tables, to a slower, and there less expensive, storage?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

733 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