Archive for April, 2009

Are All Test Environments Created Equal?

Tuesday, April 28th, 2009

I don’t know about your environment, but at mine we have two classes of systems: Prod and Test.  So as you can guess, anything that is not Prod is Test.  That’s a pretty simple definition.  Further defined anything that has a DR priority of 6 or less is PROD and anything 7 or greater (or not graded) is test.  This makes live very simple, or so it would seem.  So that brings me back to my question: Are All test environments created equal?  On the one hand an answer of “yes” lets everyone know what to expect.

  • Will the Test system be backed up?
  • If it is backed up, what is the retention?
  • What level of disk redundancy is available?
  • Can Test servers be physical hardware or VM only?
  • What is the recovery priority if needed?

This sounds like a pretty straight forward way to go.  But on the other hand does one size fit all? We use many of our test systems for training.  The current production system refreshed the test system, the upgrades are done to the test system and the end users are trained on the new system using the test environment.  New employees are also trained on this system on an ongoing basis.  So here’s the scenario.  A medical system is going live in 2 days.  100 nurses need to be trained. Training takes 2 hours.  The medical facility calls in PRN staff to cover the nurses during training.  Let’s just assume all the nurses make the nation average that I googled a few minutes ago of $45,000 per year + benefits or $21.63 per hour + 39% benefit package.  (yep, made that benefit number up makes it an easier $30.00 per hour labor cost) lets also say the training room can accommodate 10 students.  Just for fun, lets also say the contract with the trainer is for two 12 hour days at $50.00 per hour including expenses.  My calculations work out to about $660.00 per hour of training or sitting if the test system is not available. 

  • $30.00 per hour of the nurse in training
  • $30.00 per hour of the nurse replacing the nurse in training
  • $60.00 per instruction hour by the trainer ($600 per day/10 instruction hours)
  • Ten nurses and replacements

I’d hate to image the cost if we were training doctors rather than nurses.  Does that system have the same requirements as the “sandbox” I use to experiment and document the SQL 2005 SP3 upgrade?

So when does this discussion happen?  Usually it involves the SAN/Backup team.  They are charged with providing disk for servers and ensuring that what is on that disk is archived and recoverable within a reasonable time.  I don’t envy their position at all.  They also have to balance backup windows, and backing up test databases uses equipment and storage that the Prod system could be using.  There are only so many data paths and hours in the day and purging old data seems to be a thing of the past.  So I’m not sure a simplistic look at Prod/Test is appropriate.  As we look at tiered storage, tiered version of SQL do we also need to look at tiered test environments or break the model completely and add a couple more tiers.  Prod, Train, Test, Sandbox.  Then place policies and expectations at each level.  How about your environment?  Do you ever struggle with getting other teams to understand the cost of data that is not “Production”?  Of course that leads into the “we want to test this software and see if it solves the problem and now we have 100 users depending on it” issue, but that’s another day.

Home PC Backups

Wednesday, April 15th, 2009

I have been noticing a scary trend over the last few years.  Home computers have gone from a techno-toy (like a DVD player) to an important part of everyone’s life.  I have also noticed that computers are becoming 5 year assets.  People are replacing them every 5 years.  Today they are inexpensive enough to do that.  But the trend I am seeing is that the old PC is not being replaced, but a notebook is being added to the home computer.  So I have a lot of family and friends with 4 to 5 year old desktop PCs, and hard drives are beginning to fail.  Since most PCs came in as toys, disaster recovery is typically not considered by the home user.  Does the thought of loosing all you digital pictures, your password database that you are allowing your web browser of choice manage for you, or any document you have created scare you?  It should.  A couple of people have asked me my strategy so here it is.  I use a three pronged approach.  I have a wireless network in my house.  Every night at 2:00 am (wow, now that I think of that it is a really bad time to choose now that Indiana is on daylight saving time) *Note to self reschedule backups*.   I copy my documents folder to another PC that is on different power circuit in a different part of the house.  I also copy that data to a USB connected disk.  Please note, this is not a backup plan.  I cannot step back in time and get an old version of a changed file.  But in most cases I don’t need that.  Then once a month, I burn what I feel is most important (pictures, keepass password database, e-mail archive) to DVD and store it off-site.   I point all my applications to store their data in that location.  I am not saying this is the best strategy, but I would like you to at least think about your strategy.  The day after a hard drive crash is not the time to consider this.  Just remember, that e-mail and web surfing appliance is becoming a critical part of your life.  Protect it.

Renaming a SQL server

Monday, April 13th, 2009

Here’s a little simple one that I’ll probably need again, so I thought I’d just blog it:

How to rename a SQL server used mostly when the windows server it resides on changes names:

To change the name of a default instance of SQL, run the following procedures:

sp_dropserver <old_name>
GO
sp_addserver <new_name>, local
GO

To change the name of a named instance of SQL, run the following procedures:

sp_dropserver <old_name\instancename>
GO
sp_addserver <new_name\instancename>, local
GO

Cleaning up the disk

Monday, April 6th, 2009

When I became our companies MSSQL DBA I inherited an smooth running machine.  My predecessors were extremely talented and their scripts did everything we needed done.  But I can’t just live off their hard work, I need to leave my mark on the environment.  So I am tweaking some of their scripts to get rid of what annoys me.  The current task is old backup files.  The scripts they wrote do this awesome thing that archives a backup if the archive bit has not been cleared.  This is so cool.  If NetBackup has a problem, the old backup file that hasn’t gone to tape/disk is moved to an archive folder and then the new backup file is created.  But what happens when after the file is backed up and the archive bit is cleared.  It just sits on the disk and is backed up again with every full backup that occurs.  That makes the backups bigger and take longer.  So I added a job that deletes all *.bak files that have their archive bit cleared.  That was so much easier than I expected it to be.

exec xp_cmdshell ‘del d:\mssql\backup\*.bak /A:-A /S /F’

I run this command 15 minutes before I do the nightly backup.  It frees up space so I get less alerts of full volumes.  It decreases the NetBackUp full backup time and more backups can happen within their windows.  Unfortunately the DBAs before me decided that transaction log backups and database backups should have an extension of .bak.  Since I want to treat transaction logs differently I have to go back and change the backup extension.  So I’m slowly working through the databases to make that change.  So once that is done, I can start cleaning up my backup volumes.

Blog Direction

Monday, April 6th, 2009

I was looking over my blog and I noticed that it was heading in a direction I didn’t like.  I had stared down the path of a whiney, ranting, complaining, negative blog that way too many blogs have gone.  So I am stopping it now.  I need to get more SQL and positive posts to offset some of the negative I am seeing in the blog world.  So here is the positive for today.  I am going to focus on the positive of the “special needs” part of my world.  My eleven year old daughter was born with Down Syndrome and congenital heart defects.  At eleven months she had open heart surgery to repair those holes.  At seven years old she was diagnosed with leukemia and fought to beat that beast for two and a half years.  To put it plainly, she is a fighter.  That is the background for her newest endeavor.  She recently began theraputic riding at a local stable, and her instructor was so impressed with her abilities that she promoted her to horse riding lessons and has now begun to ride full sized horses without side walker assitance.  She also joined 4-H and is working on halter class for this years county fair.  She will be competing against typically developing kids in this class, and that’s the way she like it.  So her battle for inclusion continues as she continues to impress and break stereotypes.  She may be “special needs” but if you are competing against her in anything, don’t take her lightly, or she will take you.  Perhaps I’ll tell you about her Karate touranment last year some time.  Inclusion does work, her life is proof.