Solved

SQL database  reducing database size

Posted on 2014-09-10
3
57 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
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 78

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:ScottPletcher
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now