T-SQL Tuesday #127–Non SQL Tricks

tsqltuesdayToday is T-SQL Tuesday, with this month being hosted by Ken Fisher. This is an interesting topic, looking at tips, but ones outside of SQL Server. Since many of us are data professionals, I think this is a place where I might learn a few things from others. Looking forward to the recap.

I spent a number of years working in network administration and desktop work, as well as some software development teams, so I have to think about what I think makes a good tip.

A Quick Fix with Contig

One of the problems with a machine that runs out of memory or disk space is that it will act slow and suspicious. It often isn’t obvious that you’ve run out of resources, since we often don’t think about a slow degradation for RAM or disk space. Usually we’re looking for a runaway process, a virus, or something else. I’ve been surprised sometimes that I spent an hour, or watched someone else do this, before checking disk space.

These days Windows is better about warning us when space is low, but it can be easy to ignore this or defer action until a later time when you’re busy. This tip won’t help you with RAM, but it can help with storage, which often affects things like pagefiles.

Contig.exe is a utility from the Sysinternals utilities. It is designed to defragment files, but it can be used to create new files. Of whatever size you want. I’ve written about this before, and I use this on my machines. Whenever I get a new drive, I usually make 10 new files, each 1GB in size and keep them around. This post reminded me to do this on a new drive.

2020-06-02 21_03_35-SanDisk1MB (E_)

If I run low on space, I can get 10GB back quickly, without searching my filesystem for something to delete.

You could do the same thing with a large ISO if you want, but keeping a file ready to delete can be handy. It always seems I run out of space when I’m in a hurry to get something else done.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , . Bookmark the permalink.

3 Responses to T-SQL Tuesday #127–Non SQL Tricks

  1. Glenn Berry says:

    This is a clever idea. I do have an issue with it. First, if you get so low on disk space that having 10GB of dummy files (or a big .iso file) that you can delete will save you, then you will have been suffering with reduced performance from that drive for quite a while. This is true with both magnetic drives and NAND flash drives for different reasons.

    I just would not want to run that close to the edge, space-wise. Running Windows Disk Cleanup periodically (like after Patch Tuesday) should help you free up disk space.

    Like

  2. way0utwest says:

    I find that I just don’t often think of disk space, since it seems like I’ll have 100GB+ for months and then run low at an inconvenient time. This is really an emergency tactic, and just to buy a little time. I’m starting to think I really need 50GB in today’s world.

    Liked by 1 person

  3. Pingback: Non-SQL Tips and tricks – #tsql2sday 127 Rollup | SQL Studies

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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