Monthly Archives: June 2010

Question Everything.

waterandchalkartfestival 033

The world is full of information. So much so that we may believe there’s nothing left to write or do. As I try to get back to blogging more frequently I find myself wondering what to write about. It’s not to say my day is not full of lots of things to do. The question I was asking myself is why should I write these things when the world already has great writers and great information out there?

The answer of course is simple. Question Everything.

Ask any of the experts in a field of study and they will tell you one of the best ways to learn a new topic is to present on it. You force yourself to learn about what you’re presenting so that you are prepared for it. Now don’t get me wrong I use the scripts available out in the community all the time. I suggest them to clients and to fellow DBA’s. I am not advocating re-inventing the wheel. They are no doubt an essential tool in helping to make our lives easier and better.

Just because you get the perfect script to meet your needs doesn’t release you from responsibility from what it does. If you install a new script on your servers and it slows things down or has a negative side effect that the original designer didn’t mention or you didn’t realize, then your boss is not going to blame that on the person or blog you got the script from. They will blame you for releasing it into the environment.

So what should you do? Well as the person using the script you should read what the person who designed it wrote about it. Most of the time the designer of the script will detail what it does in blog posts or in some sort of documentation if by chance it doesn’t have that then dissect the script and figure out what it does. I prefer to take apart a script myself so that it forces you to learn how to read other’s code and how to figure out what it is doing which to me is an essential part of being a DBA. We rarely get things in the format we expect. Unfortunately many people don’t think like a DBA.

For the Senior/Master/gurus out there don’t just hand your new guys scripts and say run this and it will do what you need. Perhaps tell them you have a script that does what they need and here are the ways you did it perhaps the new guy can find a new better way. This teaches them and guides them at the same time. A good example of this is Quest’s new Perfmon counter poster. You have a lot of information at your fingertips but don’t just look at the benchmark numbers and assume that’s what works for all situations make sure to benchmark your own servers and find out what numbers are right for your situation. As I read through this new poster this weekend I realized there was some things I could change in what I was tracking to give me more information about my server.

If your one of the ones out there writing the scripts THANK YOU! I applaud anyone that has put something out there for others to use and that has helped make our lives a little easier. Keep up the good work and keep doing what you’re doing.

24 Hours of PASS Recordings

                 Oregon Road Trip-222

It’s over! It’s gone we just can’t get it back! Just in case you missed the most recent 24 hours of PASS don’t worry, you can relax because it’s available via recording! So don’t  worry just click on the link below and all your troubles(and performance issues will be fixed). 🙂

http://www.sqlpass.org/LearningCenter/24Hours.aspx

You will need a Pass login to view the recordings.  It’s free so sign up now grab some popcorn and Mountain dew and get watching.  🙂

DTExec and SSIS

I could list lots of excuses as to why it’s been so long since I blogged but I’d rather get to the blog post so let’s just say I’m lazy and working on getting better.  🙂

I’ve been doing work with SSIS and running it at a command prompt so I could use it to load test a Database.  My hope is later to move this into a simple application that calls the procedures I want but until I start learning C# for now I’ll stick with SSIS. 

The problem I ran into was passing parameters.  I have a loop inside my package and I want it to run X amount of times for my testing needs.  That’s not a problem on setting up the loop you can find that here.  But how do you pass the variable to the package so that you can tell it how many loops you want?  Well for that here is  another blog that talks about it.    Ok so now that I’ve linked off most this post to others what the hell am I trying to add to all this?

Well I read those blogs and it worked until I started adding multiple set options and I ran into some simple syntax issues.  I also noticed there was few examples out there of the full syntax of what it looks like.  Call me crazy but this always screws me up when I’m trying to get syntax right with SSIS.  So here are my scripts that I use currently to execute my package. 

DTExec.exe /Rep N
/set \Package.Variables[User::iCounterEnd].Properties[Value];100
/set \Package.Variables[User::RunDataLoad].Properties[Value];-1
/set \Package.Variables[User::InitialLoadEnd].Properties[Value];1000000
/File "c:\TestAdventureWorks\runstresstests.dtsx"

Now as you might guess in my package I have  3 variables called iCounterEnd,RunDataLoad and InitialLoadEnd.  For all you SQL people out there that are not use to coding environments they are case sensitive(yes this has been hard for me as well).  Also notice that RunDataLoad is a –1.  The variable is a Boolean which I would have assumed would say “true” or “False”  but I was wrong.  It is –1(True) or 0(false) for the setting. 

Now a great way to get examples of what should and should not be is to use Package Configurations.  If you enable package configurations and write an xml file down to some directory then you can get the variable path/name that you need and the value it’s currently set to.  Here’s a screenshot of what the package config file will look like. 

ssisconfig

The Path = is what you need above to make sure you have the correct path to the variable. 

Hopefully this will help others to take a little less time to get a package to run from the command line.

Pat