Author: way0utwest

  • #sqlhelp

    I know that Twitter is really representative of only a fraction of the people in the world, and arguably it’s not even a good representation of any group because it’s a self-selective group that chooses to share thoughts, ideas, news, etc. with the world. However I do enjoy the medium, and find myself learning about the world, thinking about opinions, and once in awhile, getting help.

    There is a hashtag on Twitter called #sqlhelp. It’s an amazing tool that I’d highly encourage all of you to consider when you want a quick answer to a problem. Hashtags are a way of denoting tweets about a common subject, though there is no official set of hashtags. You can make one up yourself and see if it catches on.

    #sqlhelp certainly did, and I find it useful for many short, quick questions. While I was writing this piece, I saw questions come up on licensing, Oracle->SQL Server conversions, security in a database, and how to read an execution plan. I also saw some noise, with requests for consultants to teach, product advertisements, and a webinar notice. I’m slightly worried that noise level might overwhelm this channel, but if you’re on twitter, you should try using it for your next problem.

    As with any answer you get from the Internet, you should test things yourself and decide how trustworthy the source is. You might get an answer from Brent Ozar or Paul Randal, but you might get some new DBA on his first day of work. Also be aware that 140 characters can severely limit the questions you can ask. If it’s complex, I’d suggest you try the SQLServerCentral forums instead.

    Whether you like Twitter (and #sqlhelp) or not, I do believe that this is a great example of how our community does a great job of helping each other out. We teach, learn, support, and inspire each other, arguably more than any other industry or technological group I know of. It’s a joy to be a part of the community, and I’d encourage you to join us on Twitter, forums, or local events.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 3.3MB) podcast or subscribe to the feed at iTunes and Mevio . feed

    The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at www.everydayjones.com.

  • A True SQL OS

    Today’s editorial was originally published on Aug 26, 2009. It is being re-run as Steve is on vacation.

    I have heard a number of talks from SQL Server developers at Microsoft that refer to the internal SQL Server database engine as the “SQL OS,” since it almost exists as its own operating system from their perspective. Much of the development work these people have done in scheduling, threading, memory management and more, is reminiscent of the work done on operating systems. So it’s called the SQL OS.

    As SQL Server has grown wider and wider, incorporating more and more features, it almost seems to have all the features that might qualify it as its own operating system, but it still has dependencies on Windows, and exists as a service under Windows. That is both good and bad, since you can easily use your physical server for other applications, but those applications can take resources away from SQL Server and cause contention.

    Since it seems that many people make a practice of only installing SQL Server on a machine, it makes me think that we’re actually ready for a true SQL OS, one that is installed on a machine and has no other capabilities other than what is inside SQL Server.  I think this could be done today, perhaps using a specialized Server Core installation in Windows, and eliminate the possibility of anything interfering with SQL Server itself. We could still add it to a Windows host if needed, but we’d have the option of a specialized SQL box, maybe as an Enterprise feature.

    There could be some great advantages of going down this path. Windows I/O and scheduling could be tuned specifically for SQL Server, or just incorporated into the SQL Server platform. With VMs, you could still partition your hardware to have a SQL VM and another Windows VM for other applications. The new Filestream features could be extended to allow file operations to the SQL Server instance, and what’s more, we could then access and manipulate these files from within the server. Doing so in a separate file system is a constant challenge for many developers and DBAs.

    I don’t think this will happen for a few reasons, not the least of which is licensing. There’s a Windows and a SQL Server license for every instance, and I can’t see Microsoft wanting to sell less copies of Windows.

    However it’s nice to dream of a way to build a SQL Server platform that only requires DBAs.

    Steve Jones


    The Voice of the DBA Podcasts

    Everyday Jones

    The podcast feeds are available at sqlservercentral.mevio.com. Comments are definitely appreciated and wanted, and you can get feeds from there.

    You can also follow Steve Jones on Twitter:

    Overall RSS Feed: or now on iTunes!

    Today’s podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at www.everydayjones.com.

    I really appreciate and value feedback on the podcasts. Let us know what you like, don’t like, or even send in ideas for the show. If you’d like to comment, post something here. The boss will be sure to read it.

  • T-SQL Tuesday #52 – Arguments

    tsqltuesdayIt’s time for T-SQL Tuesday, this month hosted by Michael J Swart, our artistic DBA in the community. I love Michael’s pictures, and enjoy the time I get to chat with him at events.

    His invitation this month for #52 is to argue against a popular opinion. He asking us to find a "never ever" issue and argue for it. Or perhaps an "always do this" advice and argue against that. It’s a great topic.

    T-SQL Tuesday is the monthly blog party, invented by Adam Machanic. The second Tuesday of the month is the time to publish a post on your own blog about the topic and join the other people that write about the same topic.

    Never Turn on Auto Shrink

    I think that if you turn on the auto-shrink setting, Paul Randal rips an LED off his interactive panels. Even if he doesn’t, why would you ever enable auto shrink? It causes fragmentation, it’s somewhat insane as your files will just regrow if the space is needed for a workload such as a maintenance operation.

    The recommendation is to never turn on Auto Shrink on your databases. There are numerous references, though I’ll point to Brent Ozar’s nice summary. I’m going to pick a fight with this advice, though only in a narrow, limited sense.

    Auto shrink is, in general, a very bad idea. However I think there are a few places where I’d use the setting, understanding the implications.

    The Road Warrior

    There was a salesperson that had a laptop, traveling around and working his a piece of SQL Server (Express) based software. Let’s call him Joe, since that’s a nice generic name for this story.

    When Joe arrived at a client site, he’d get data from the clients in an Excel spreadsheet. He’d use the import wizard, load a bunch of data into a new table, point his software at it, and do some analysis of the data. He’d then make recommendations to the client and sell something based on his recommendations. When he was done, he’d click a button in the software and drop the table. The amount of data from clients varied, and it sometimes caused his database (and log files) to grow. He’d also forget to the drop the table sometimes and would wind up with 4-5 clients’ worth of data before he removed the tables.

    Over time, this also caused his laptop to run low on space. This wasn’t a big deal, and the help desk could respond to his concerns by remotely running a shrink of the files for him. However the time spent dealing with questions, and the concern that Joe experienced weren’t worth the effort. Auto-shrink worked fine for Joe and some of his colleagues.

    Performance wasn’t a big concern, as a single user accessed the database. The data didn’t live long enough to worry about fragmentation or maintenance and the reduction in irritation from Joe and the help desk was worth it.

    The Dusty Archives

    I once worked in a company that had an archive database. We had a process that copied data from previous years to a new database that was taken offline and a copy burned to a few optical discs for long term archival. We actually build this process to use a separate instance for the copy as the source SQL Servers were located in various parts of the US, and the data was remotely transferred to a central location for archival, and because we didn’t want to ship optical drives to multiple locations and explain to warehouse personnel how to use them.

    I, and my cohorts in IT, also didn’t really want to travel to small, inconvenient warehouses located in small cities without direct flights.

    One of the requirements was that we make these databases as small as possible to save space. We typically built a few archive databases before we shrank them and took them offline. In hindsight, the process of copying the data should have minimized the size of data and log files with its own shrink, but that wasn’t the case. An administrator needed to perform the shrink and sometimes they’d forget. Actually, most of the time they’d forget.

    The simplest solution was to enable auto shrink on this instance. That way once database files were sitting on the instance for any length of time, the databases would shrink themselves. No need for anyone to worry.

    Performance wasn’t an issue in these cases as recovery of the data would have meant a transfer back to a source system, where fragmentation and indexing would have been a concern.

    Narrow Cases

    In both cases, the reason auto shrink worked was performance wasn’t an issue, and administration was. Performance didn’t matter, and it wasn’t a heavily used system. I think these, and perhaps a few other narrowly defined cases are acceptable uses of Auto Shrink.

    However I also think there are many more abuses of the setting and I’d prefer it removed from SQL Server. Scheduling this process with Powershell would be trivial if you really needed it.

    And if you don’t know how to use Powershell (or SQLCMD), perhaps you shouldn’t be shrinking database files.

  • Developers, developers, developers

    StackOverflow ran a survey for their members in 2013 and released some results recently. The results are on their blog, along with some observations about the data. While most of this audience aren’t in the development space, some may be, and the impacts of the results could certainly affect our careers.
    Most developers and applications aren’t getting much accomplished without data, and whether they use SQL Server, another RDBMS, a NoSQL platform, or a dumb data store, chances are we can help them. Chances are also that if they make a poor decision, we’ll be dealing with the mess in some way.
    The observations note that mobile is still growing, and I believe that. I still think the mobile market will dwarf the PC explosion we’ve seen the last 20 years, and that means we should be preparing and understanding how to deal with data from mobile devices, think about scaling to meet lots of small, quick calls for data from a device.
    I also like the fact that more people are working remotely. If they let developers work remotely, that’s a good step towards DBAs becoming remote as well. As someone that has worked from home for over a decade, I appreciate the challenges, but I still can’t help but thing my productivity is much higher than it ever was in an office.
    It’s also nice that the second most popular language (in use) is SQL. Not necessarily T-SQL, as I’m sure various other platforms are developed on, but it does show that SQL is very important, even to developers. Perhaps the next time a developer is struggling with SQL, you can refer them to this survey and then see if you can help them improve their query skills.
    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 2.4MB) podcast or subscribe to the feed at iTunes and Mevio . feed

    The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at www.everydayjones.com.