Author: way0utwest

  • Technology for Sharing

    Zipcar
    Zipcar has done a great job of using technology to more efficiently manage assets in the real world.

    Computer technology has done an amazing job of making many parts of business more efficient. It has streamlined processes, freed up many people from relatively menial tasks and increased the speed at which we can accomplish many things. This has been both good and bad, as fewer people are needed in many positions because of the capabilities of technology, but this has also freed many more people up to spend more time thinking about more complex problems.

    We have also seen investments in computer technology result in much more efficient operations in many industries. One example is our delivery companies plot our optimum routes for package delivery, saving time and fuel. Another example caught my eye the other day: car sharing for government fleets of vehicles. It’s a concept, using technology from ZipCar, that could potentially save tens of millions of dollars.

    The concept of sharing is nothing new in computing, where our applications have been sharing computer resources for decades. However a number of companies have started to expand that concept to the real world, because of the power of new technologies that allow tracking, management, and administration of physical assets. Quite a few companies have come up with a way to share resources and run a business. This same concept is something that we are doing with virualization, allowing multiple users to share the same hardware as there are significant amounts of time when any particular server is not being used to its potential.

    In the real world, we have to have enough cars to satisfy the peak demand, when the most number of people need a car, which is challenging. My guess is that some people will not be able to get a car when they need it, especially as the software tries to reduce the number of cars to the minimum level it can. We see people doing this with VMs (Virtual Machines) as well, which can lead to worse performance than expected from a particular VM. I think in many cases this is acceptable to companies in order to save money, but there are cases where it isn’t. For those cases, you might be better off with your instance on a physical host rather than a VM.

    Steve Jones


    The Voice of the DBA Podcasts

    We publish three versions of the podcast each day for you to enjoy.

  • Creating a Symmetric Key in SQL Server

    Symmetric keys in SQL Server are recommended for encrypting data in columns. They are a good balance of security and resource usage, much better than asymmetric keys. Creating a symmetric key is fairly simple, using DDL that’s easy to understand.

    One note before I show this is that symmetric keys are deterministic when created, meaning that the same parameters run in different databases will result in the same key. That means that the same key in a different database (or instance) can decrypt data that was encrypted in your production instance. Keep control of the parameters used to create symmetric keys and secure them. That means watch out for storage of these items in source control, in installation files, upgrade scripts, etc.

    Creating a Key

    The creation DDL used is the CREATE SYMMETRIC KEY statement. This command has a number of parameters that you can change. The important ones for most people are:

    • the algorithm
    • the encryption mechanism
    • the key source
    • the identity value

    You should try to use the most secure algorithm you can, which is AES_256 in SQL Server 2012. It’s the same back to SQL Server 2005. You should avoid the RC4 algorithms, since they are not terribly secure. Even the DES ones you might avoid, but do some research to understand if you have a need to use anything less than AES_256.

    The encryption mechanism provides protection for the key. You can use a password (secure it) or you can use another key. The common way to secure the symmetric key is with an asymmetric key (or a certificate). However if you have the option to use a hardware module with the extensible key management (EKM) system, use that. You can use multiple encryption mechanisms if needed, which might be useful for separating the access to this key for different users.

    The key source provides a way to seed the key. This is a parameter you need to regenerate the key.

    The identity value is optional, but provides more a passphrase to tag a key. Useful for temporary keys.

    To actually build a key, let’s create one here using a few parameters, and securing it with a password:

    -- create a symmetric key
    create symmetric key MySalaryProtector
     WITH ALGORITHM=AES_256
        , IDENTITY_VALUE = 'Salary Protection Key'
        , Key_SOURCE = N'Keep this phrase a secr#t'
      ENCRYPTION BY PASSWORD = 'Us#aStrongP2ssword';
    go
    

    That’s it, once you have executed this, you have created a key. You can see your symmetric keys by querying sys.symmetric_keys

    SELECT * FROM sys.symmetric_keys

    sym_key_a

     

    That’s all you need to do. There’s not backup or restore of a key; if you need to recreate it, supply the same parameters and you’ll get the same key. The keys are stored in the backup of a database, so if you restore from backup, you’ll have them back as well.

    In another post, I’ll look at actually encrypting data with a key.

  • SQL Backup 7

    sqlbackuproWhat more could you add to a SQL Server backup product? It seems that many software products, including Red Gate’s SQL Backup Pro, have been able to handle the things most DBAs care about for some time: compression and encryption. Today my company has released a new version of SQL Backup, version 7, which does add a couple of very nice features.

    One of the problems that exists in many database configuration is the lack of verification of the backups, and a lack of consistency checking for corruption. Both of these are fairly rare events, but when they do strike, they can propagate through backups for weeks, months, or even years at times. When a disaster does strike, this can result in a tremendous amount of lost data for an organization.

    SQL Backup Pro 7 helps to ensure your backups can be verified and checked for issues with the addition of two great new features: scheduled restores and automated verification checks.

    You can see a walkthrough of the features from my colleague, Grant Fritchey, on the Red Gate website. Grant shows how you can automate the restores, to another server, and run your DBCC checks.

    Run these Checks

    When corruption strikes, you may not be able to actually recover data. It could be too late, so it’s important that you regularly run DBCC checks. However it can be a performance issue on your production server since DBCC is resource intensive. The solution is to offload these checks to another instance, but for many DBAs, the scripting required to ensure this runs every day is rather complicated. You can do it any number of ways (T-SQL, PowerShell, VBScript, etc), but it’s important that you do it.

    The addition of this feature to Backup Pro is something myself, Brad McGehee, Grant Fritchey, and others have been requesting for some time. The ease with which you can set this up means there is no reason not to run your DBCC on almost every backup file.

  • Smelly Power

    waste treatment data center
    Not sure I’d want to work here, at least not without a clothespin for my nose.

    Power is a limited resource and it’s become an issue in more and more data centers over the years. As we use more computing resources, the effort to provide power becomes a challenge. A decade ago I wrote an inventory system to help us keep track of our thousands of servers. The challenge of locating a particular machine to manage the hardware was a problem for our hardware people, and we built a system to allow them to easily find a particular server, with hardware configuration updated from software queries made by our management software.

    Almost as soon as we got the system deployed, we had to modify it to add additional pieces of data related to power and heat. We were approaching the limits of both, and knowing where we had spare power, the consumption of power on each circuit as well as the heat load in different parts of the room allowed our hardware people to better plan for future requirements.

    Over the last few years I’ve seen some creative solutions being used to build new data centers and handle the power and cooling requirements. Google has built data centers near rivers and hydroelectric generators to take advantage of those resources. Old mines and open air cooling solutions have been implemented, and just recently I saw Microsoft had one thing I’d never thought of: a waste-powered data center. That’s a new one for computing, though a local brewery in Colorado has been using methane to generate power for a few years.

    I like the idea of trying new solutions, and trying to build a sustainable energy source that uses less of our fossil fuels. It makes sense to me, and seems like it’s a longer term view of advancing our computing infrastructure in a cost effective way. I applaud Microsoft for trying this; I’m just not sure I’d want to be the DBA working in this particular data center.

    Steve Jones


    The Voice of the DBA Podcasts

    We publish three versions of the podcast each day for you to enjoy.