?
Solved

SQL database  reducing database size

Posted on 2014-09-10
3
Medium Priority
?
64 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 2000 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 82

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
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.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

765 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