4 Shortcuts to clearing up disk space in record time on your SQL Server

You know the drill, everything is running along smoothly and then suddenly it’s panic stations! Oh no the database server has run out of space and everyone starts running around like headless chickens. Here are four quick ways that you can clear up space right away, and get your server back up and running.

1. Shrink a log file that has filled up

Right click on db, Tasks:Shrink:Files Select log file and click on OK.
(check the db is either in simple recovery mode , or if not make sure that you have backed up the log first)

2. How to shrink Tempdb

The simplest, quickest way to shrink Tempdb is to restart the SQL Service. Upon restart SQL will delete the Tempdb files, and recreate
them back to their original size.

3. How to move a database

Find out which files are used by the database. Detach the database (right click, Tasks:Detach), move files and reattach. (Right click on Databases and select attach)

4. How to compress a backup

When backing up the database go into options and select ‘Compress Backup’

When you are a DBA you will be put under a lot of pressure when things go wrong. Always remember to keep a cool head and don’t make rash decisions. Taking a few minutes (or however long you need) to think about the situation and make sensible choices is very important if you want to last in your career as a DBA.

Rob StGeorge
Senior SQL Server Database Administrator residing in Auckland, NZ

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.