Author: way0utwest

  • Know when to hold ’em

    The SQLServerCentral party is always a great time

    It’s time for the annual SQLServerCental party at the PASS conference in Seattle again. It’s become an event that’s a lot of fun, and a great way for the SQL Server community to have some fun and get to know each other in a relaxed atmosphere. This year we’ve once again combined the party with the Exceptional DBA awards, and I’m honored to be there to celebrate noted SQLServerCentral author Jeff Moden as the winner.

    We have once again contracted for a casino themed party with various game tables around. We’ll call them the card game where you try to get twenty one, the competitive card game with a flop, river and turn, the roll-the-ball-around-the-circle-and-guess-the-number game, and probably that dice game as well. Have to be careful with the spam filters these days. 😉

    This year we’re selling tickets in advance for $20, or you can bring $30 to the door. We’ll have lots of prizes again, with me going through Best Buy and Think Geek to get a large variety of things to give away. I am happy to take suggestions for those items that you think would be fun gifts to take home.

    No skill is needed at the games as we’ll give prizes away randomly to people playing at the tables. Even if you have no idea what you’re doing, stick a few chips down,  introduce yourself to the player next to you and get some advice. You might learn something, and more importantly, you might make a friend.

    Come join us on Tuesday night for a great time. More details are in the party announcement.

    Steve Jones


    The Voice of the DBA Podcasts

  • How Should We Pay People?

    It’s an interesting article on how to pay people from Dan Ariely at Business Week. It’s a look at some of the issues with paying for knowledge work, or work that isn’t well defined. The short version is that you don’t want to specify too tightly what you expect people to do, but then you have to motivate them to work in the best interests of the company.

    I think this is one of the fundamental problems in management today. We still have this mentality from the blue collar factory worker and piecemeal or easily measurable work items being applied by management to knowledge workers. It doesn’t work well, and somehow we think that the hours work in some way relate to the output.

    I blame lawyers. They tend to use this model, since they often bill by the hour. However the end result, the quality of that they produce, which is usually research, isn’t easily quantified in anything other than a win or loss. That often comes down to not only the soundness of the argument or the logic, but the charisma of the lawyer. That’s not even close to the way we do business in many other industries, especially technology.

  • Recovery Models

    In SQL Server we have three basic recovery models: full, bulk-logged, and simple. By default we find that most databases use the defaults, which mean that they are in the full recovery model.

    In that case, you need to be sure that you are performing log backups, otherwise the log will grow until it reaches it’s limits, or you run out of disk space on that drive. If the log cannot record SQL Server transactions, the database cannot accept any more transactions.

    The basics of recovery models are covered nicely in this article from Gail Shaw, which includes some common myths and misconceptions out there. However for the average person, the important thing is that you understand which recovery model to pick.

    You Need Point in Time Recovery

    Point in time recovery means recovery in between the full or differential backups. Quite a few DBAs will ask customers if they really need to recover to a point in time, and get the answer that they don’t, but that’s not often the right question to ask.

    Ask your clients if the database failed at 5:00pm today, and all the work done today was lost because you restored to last night’s backup at midnight, how would they feel?

    Sometimes they’re fine with the data loss, most times they aren’t. If you need to get back to a point in time between backups, make sure you use the full recovery model.

    You Can Reload the Database

    There are some databases, usually data warehouses, that can be rebuilt from other sources. If you take a backup of your database and then load data every day that rarely changes during the day, you might not need point in time recovery. In fact, many ETL processes are not designed for this anyway, and could not restart themselves in the middle of a load if you restored to the point in time when the database had an issue.

    In this case, use the Simple recovery model.

    You are space constrained with the log

    If you run index rebuilds, or large data loads and find yourself with a transaction log that grows very large, you might want to investigate the Bulk-logged recovery model. This model is more confusing, so I don’t want to give you a general rule here. If you think you might benefit from less logging, investigate the bulk-logged recovery model, practice restores with it and make sure you fully understand the implications of using it before you set a database in this mode.

  • Probabilities and Disaster Recovery

    The risk of an event is sometimes inversely proportional to its impact.

    When I talk about disaster recovery, one of the key things that I try to stress is the idea that the amount of effort and resources you devote to the problem is often scaled to the risk of loss. It doesn’t help the company if you decide to spend $1mm to ensure extremely high availability and zero data loss for a system that generates $20k in revenue a year. It might not be worth spending $100k to protect a system from more than a day of downtime if your daily revenue is less than $5,000, but it might be. You have to decide this in your environment.

    However when we talk about disaster recovery is seems that the vast majority of people plan for a data center failure, or a hurricane, or a major disaster. Those are possibilities, but the risk of them happening is low. It’s rare that a major disaster will hit any particular part of the world and therefore the risk is often very low. With a low risk, it might not be worth spending a lot of money on extra hardware to handle a situation that may never occur. I know that most of the time the management I’ve worked for haven’t felt it was worth spending a lot of money to prepare for a major disaster. There are systems that are worth duplicating to ensure high availability, and in many cases it does seem that management is willing to pay for spare systems when downtime is an issue.

    The most common disaster that I seem to hear about is the “whoops” disaster. A disaster that’s human error, a situation where someone makes a mistake in data entry. The most common “whoops” for DBAs seems to be the UPDATE or DELETE without a WHERE clause, but it seems these days there’s no shortage of issues occurring from applications that allow users to manipulate large batches of information.Yet it seems that too often I don’t see management making the preparation for this type of disaster a priority.

    There are numerous ways to handle these types of disasters. You can set up log shipping on a delay, even to a secure workstation (remember to secure production data), to give you time to respond to a situation and recover data. There are numerous tools, such as Red Gate’s Virtual Restore and SQL Backup Pro, that allow you to mount a backup file or recovery a single object from a backup file without impacting the full database. There are log reader tools that allow you to recover data or undo transactions from the transaction log whenever issues arise. Many of these tools have a price, but the cost of downtime is usually higher. Even the cost of losing other work when highly paid professionals are spending time recovering data across hours instead of minutes would justify the cost of purchasing one of these tools instead of the cost of time spent building a data recovery solution.

    Whether you build or buy a tool to help you deal with a “whoops” disaster, you ought to ensure that you make some preparations here. The risk of you losing revenue from this type of disaster is much higher than spending weeks building a plan that provides for recovery in the event of a catastrophic disaster.


    The Voice of the DBA Podcasts