Tag: administration

  • Backup Your Certificate for TDE

    If you’ve enabled TDE, you need to be sure you have a copy of the certificate that protects the Database Encryption Key (DEK). If you follow my instructions, then you have one.

    If you didn’t make a backup, or you have just discovered a TDE database, make one now, and secure the password you use with your DR materials (off site).

    How do you make a backup? That’s easy. Use the BACKUP CERTIFICATE command. Here’s the command I use in demos:

    USE master
    ;
    go
    BACKUP CERTIFICATE TDEPRimer_CertSecurity
     TO FILE = 'tdeprimer_cert'
      WITH PRIVATE KEY (
                   FILE = 'tdeprimer_cert.pvk',
                   ENCRYPTION BY PASSWORD = 'AStr0ngB@ckUpP@ssw0rd4TDEcERT%')
    ;
    go
    
    
    

     

    The certificate for TDE is in master, so you must make sure you’re in master for the backup. The TO FILE option lets you choose the file path. By default, this will be in the DATA folder for your instance, but you can choose other locations. You can give an extension if you like. This file is the certificate (public).

    There is a private key portion of the certificate, which is backed up with the “WITH PRIVATE KEY” portion of the command. This is where you specify the password and provide the protection for your certificate.

    You will need this password on restore, so keep track of it.

  • The Costs of Data

    Most of us know that there is a cost associated with the management and storage of data. After all, it’s part of the reason many of us have jobs as data professionals. Our salary is a cost, though we also realize there are real costs in electricity, on-line storage, backup storage, and more that relate to the stewardship of data.

    Many US government agencies are being asked to share more of their data publicly, but without additional funding. That could mean less research is funded as the cost of opening their databases rises. How this should be handled is open to debate, but Vint Cerf and others have noted that someone has to pay to manage data, and public/private partnerships are a potential solution. However, the fate and cost of public data isn’t the core issue.

    The core issue is that data sets are growing, and in some cases, growing at phenomenal rates. We see companies getting caught up in the Big Data hype, often gathering and storing data just because they have the ability to capture more data. However as our data volumes, and rates of growth increase, that impacts the performance, and perhaps availability, of our systems. Perhaps more to the core for many of us, all the data impacts the performance of our jobs. Systems might run slower, we have more work to do to analyze data, write reports, or deal with the every widening array of tools that people want to use to analyze the bits and bytes we manage.

    The costs of data storage, of tracking and managing systems, or administering a multitude of environments, of supporting new tools for analysis, are going to grow. Most likely that means that each of us will be asked to handle more data, with few staff increases. We will be more valuable, but more will be demanded of us. The physical costs will be easy to measure, but I do worry about the personal costs, in stress and pressure, as we each continue to do more and more every year.

    Steve Jones

    Video and Audio versions

    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.

    Follow Steve Jones on Twitter to find links and database related items and announcements.
    Steve Jones Windows Media Video ( 15.7MB) feed

    MP4 iPod Video ( 19.3MB) feed

    MP3 Audio ( 3.8MB) feed

    Feeds are available at iTunes and Mevio

    To submit an article, rant or editorial,
    log in to the Contribution Center

  • Restoring a TDE Database on a New Instance

    You’ve enabled Transparent Data Encryption (TDE) on one of your databases, and the server has failed. How do you get this database working on a new instance? This short post will show you how this works.

    Files Needed

    There are two files you need in order to restore the database.

    1. A full backup of the TDE database
    2. A backup of the server certificate that protects the Database Encryption Key (DEK).

    You might have multiple files for the backup, and potentially other backup files (diff, log), but the process for those will be the same as any other restore once you complete this process.

    If you have multiple full backup files (striped backup), just include them in the restore command as you normally would.

    Prepare the New Instance

    To prepare the new instance for restore, you need to ensure that you have a database master key (DMK) in the master database. You can do this by checking the master_keys DMV.

    SELECT * FROM sys.symmetric_keys

     

    If you have a key, that’s fine. If you don’t, you can create one like this:

    CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'sdkj3G3$sh'

    Now you need to restore the certificate from your source instance. You do this with the CREATE CERTIFICATE command, and the FROM FILE option. You’ll typically find the backup from your BACKUP CERTIFICATE command in the DATA folder for SQL Server if you didn’t specify a complete path.

    You do have a backup, right?

    For me, I’ll run the create certificate command:

    CREATE CERTIFICATE TDEPRimer_CertSecurity FROM FILE = 'D:\SQLServer\MSSQL11.MSSQLSERVER\MSSQL\Backup\tdeprimer_cert' WITH PRIVATE KEY ( FILE = 'D:\SQLServer\MSSQL11.MSSQLSERVER\MSSQL\Backup\tdeprimer_cert.pvk', DECRYPTION BY PASSWORD = 'AStr0ngB@ckUpP@ssw0rd4TDEcERT%') ; go

     

    This works

    tde_a

    Now I’m ready to restore the TDE database.

    tde_b

    I select my backup file, and everything proceeds as a normal restore. How do I know the certificate worked?

    Because I have a “Ready” at the top of the dialog.

    tde_c

    If I didn’t have the certificate on the instance, I’d get this:

    tde_d

    Double clicking that would bring up the error:

    tde_e

    If the certificate is not on the instance, then the server cannot decrypt the DEK and restore the database.

    Hope this helps, and if you use TDE, make sure you can do this.

  • Patch Problems

    I ran across this article a week or so ago, but hadn’t had a chance to put anything out. There were three patches put out in July for various products that caused issues with other software, one of which was SQL Server.  can cause issues with SQL Server 2012, though it looks like the patch was pulled. Be careful if you have administrators that tend to apply the monthly security patches.

    Overall, despite the tone of the article, I’m not sure how bad this is in terms of patches. While the errors are problematic and annoying, I’m not sure these are critical issues. These aren’t causing reboots or re-installations of Windows. I’ve certainly seen worse patches released, though not in quite some time. The most disturbing item in the piece was the fact that the Windows 8/RT servicing stack update cannot be uninstalled. That’s a bit of an issue, and it concerns me as we move towards a more automated, bulk patch process.

    It’s one thing for me to uninstall an application on my phone and reinstall a patched one when there’s an issue. I’ve had this happen, with vendors releasing a new version in a day or two (or for all I know, the old version), that I can reinstall. It’s quite another thing for a large vendor like Microsoft to release a patch that cripples large numbers of devices. It’s easy to pick on Microsoft, but imagine Apple, Verizon, Dropbox, etc. releases a version that crashes machines or devices. It might be significantly harder to even reconnect these devices to recover from patches that crashed core, kernel level software.

    Software has bugs, and it will always have bugs. Patches will always be needed, and IMHO, should be included as part of some warranty for digital goods. However I think patching needs to be considered at the beginning, with installation and removal, as well as user option-to-install, built into all software for sale.

    Steve Jones

    Video and Audio versions

    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.

    Follow Steve Jones on Twitter to find links and database related items and announcements.
    Steve Jones Windows Media Video ( 17.5MB) feed

    MP4 iPod Video ( 20.8MB) feed

    MP3 Audio ( 4.2MB) feed

    Feeds are available at iTunes and Mevio

    To submit an article, rant or editorial,
    log in to the Contribution Center