Solved

SQL database  reducing database size

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

911 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

25 Experts available now in Live!

Get 1:1 Help Now