Category: Blog

  • Argenis and Ryan

    It’s the time of the year when PASS holds its annual elections for the board of directors. This year we have four candidates for 3 slots: Jennifer Stirrup, Tim Ford, Argenis Fernandez and Ryan Adams. Jennifer and Tim have been serving on the board the last few years, with newcomers, Argenis and Ryan, seeking to join the organization.

    I haven’t been too involved the last few years with PASS formally, though I do try to support the SQL Saturdays as best I can throughout the year. I’m still amazed at how well Karla does in facilitating so many events each year. I can only hope that continues.

    This year I’m writing to endorse two of the candidates. Argenis and Ryan are both members of the community that support both events and people, giving to others where they can. They have strong, and thoughtful opinions, both of which I value. I also like change, and I’d like to see the focus and mission of PASS change a bit to consider its membership more than its profits.

    This isn’t to say that I think Jennifer and Tim haven’t done a good job. They are also fine candidates, well qualified, and thoughtful. If either, or both, of them are elected, the organization will do well.

    I just like change in leadership. I like new ideas and fresh perspectives.

    I do urge all of you to take a few minutes of your time and look at the candidates. Read what they’ve written and then spend a few more minutes voting when elections open. This is a small request that can help us our professional organization continue to thrive.

  • Share Your Passion at Summit ‘15

    Every Monday night on the week of the PASS Summit. Andy Warren and I host a networking dinner. This year we’re at the Yard House, and we’d love for you to come by if you don’t have plans Monday night. The event is from 6-9, but come early, come late, whatever works.

    You are responsible for paying your own way. You don’t have to eat dinner, but Andy and I will greet you and then introduce you to a few others that we hope you can enjoy an our or so with. All we ask is that you register so we know how many people are coming.

    We Can’t Do It All

    We set up the dinner as an event that people might enjoy if they didn’t have other plans. While there are a number of parties going on all week, most of the attendees don’t get invitations.

    We want to help everyone have a good time.

    With that in mind, we have asked a few people to think about hosting their own events after ours on Monday. The event could be anything from going to taste beers at the Tap House to having a cup of coffee at Barnes and Nobles (Andy’s choice) to listening to a local band at a bar somewhere near downtown. Pick anything you like to do and host a small event. It doesn’t have to cost anything, and who knows who you’ll meet.

    We have a few suggestions if you’d like to do something.

    • Choose an event you enjoy.
    • Pick something within walking distance from the Convention Center. The Space Needle is about as far as I might go from downtown.
    • Setup an event on EventBrite, Meetup, or somewhere else. Set a small limit to your tickets.
    • Let people know if there’s a theme or what you are looking to do. For example, chatting about good books at Barnes and Noble is a great choice.
    • Let people know if there is a cost. I’d highly recommend someone try to get people to do the Underground Tour. However you probably need to let them know to buy tickets in advance.
    • Enjoy

    This is a great way to meet some of your fellow data professionals. I’d love to see a few dozen events pop up every night during the week.

    If you’ve got questions, ask. If you have events, let me know, and I’ll try to publish them. We already have one, from the Midnight DBAs. Register for their Top Po Donuts get together on Monday night, or feel free to come to our networking dinner.

    Register for the Networking Dinner Monday, Oct 26

  • Custom Column in SQL Data Generator

    This is a series on SQL Data Generator, covering some interesting scenarios I’ve run into. If you’ve never tried it, SQL Data Generator is a part of the SQL Toolbelt. Give it a try today with an evaluation today.

    One of the interesting things with Redgate’s SQL Data Generator (SDG) is that it allows the user of custom data patterns for your columns. The user of regular expressions (RegEx) is used, which is something I find many SQL Server DBAs don’t really work with often.

    While there are plenty of RegEx tutorials out there, I wanted to give some simple ideas here that I’ve used to make slightly more realistic data.

    Help

    There’s a help icon available if you choose a column in one of your tables and have a regular expression selected. In this case, I can see there are a few different suggestions for the “title” column.

    2015-08-28 09_30_34-

    SDG guesses that title is a Mr/Mrs/Ms field, but it’s not. I really need something that looks like the title of an article. If I scan through some of the articles on SQLServerCentral, I see titles like:

    In this case, there are a few patterns. SQL Server appears in a few places, Some articles user a “top x” type of format. The word lengths vary, and are in the 6-12 range. Around six or so words are in many titles.

    Building a Regular Expression

    I could certainly do something like this, which just gives me a few words made up of random letters, of the specified lengths.

    [A-Z]{3} [A-Z]{5} [A-Z]{7} [A-Z]{4}

    I’ve got a 3 letter word, then a 5 letter one, then 7, then 4. All upper case, all random. That gives me results like this:

    2015-08-28 09_38_37-SQL Data Generator - TestSDG.sqlgen _

    Not quite what I want. I’d rather have some words at the beginning like “A”, “The”, or “Top”. I can do that with literals.I enclose those in parenthesis rather then brackets.

    (A|The|Top) [A-Z]{5} [A-Z]{7} [A-Z]{4}

    This gives me something slightly better.

    2015-08-28 09_41_23-Get Started

    Not perfect, but better. Let’s clean up the words themselves, following some capitalization rules for titles. In this case, we’ll use a pattern like this:

    [A-Z]{1}[a-z]{5}

    Now I see something a bit better. This doesn’t make complete sense, but it does look like random word structures.

    2015-08-28 09_43_20-SQL Data Generator - TestSDG.sqlgen _

    Let’s change the “Top” item to include a number. I can do that, but changing just the part of the OR (|) that includes Top. I’ll do that like this:

    (A|The|Top [3-7]{1})

    Now I see a number, randomly from 3 to 7, when Top comes up.

    2015-08-28 09_46_20-SQL Data Generator - TestSDG.sqlgen _

    This still isn’t great. How about if I include SQL Server at the end? I’ll use a space, or something with SQL Server.

    ( |(in|for|on) SQL Server)

    That shows me a random addition to SQL Server a the end of some titles.

    2015-08-28 09_48_31-SQL Data Generator - TestSDG.sqlgen _

    Getting better. I can even use the space or something to get the versions of SQL Server.

    ( |(in|for|on) SQL Server ( |2005|2008|2012|2014))

    Now I see some interesting titles. What if I want real words instead of random ones? There’s nothing wrong with random data for testing, but if I’m actually trying to compare data values in queries, it’s hard to focus on and remember random patterns. I could use the same OR values.

    (A|The|Top [3-7]{1}) (Blocking|Indexing|Tuning|T-SQL) (Tips|Techniques|Methods) (for| |in) ( |(in|for|on) SQL Server ( |2005|2008|2012|2014))

    Now I get some interesting, and perhaps memorable titles.

    2015-08-28 09_53_41-SQL Data Generator - TestSDG.sqlgen _

    Have Fun

    For much of our development work, the data itself doesn’t matter, but if needs to be easily discerned if you want to ensure that it’s easy to examine in queries. While random values work fine, I find them hard to deal with.

    I like the idea of using random words. Often the results are still nonsense, but they can be fun to work with. They remind me of a set of magnets my kids have on the fridge. Each is a word that will get randomly combined with others for humorous sentences.

    You can do the same thing with some RegEx and SDG.

  • T-SQL Tuesday #70 – The Enterprise

    tsqltuesdayIt’s hard to believe this is the 70th edition of T-SQL Tuesday. I haven’t missed many, and I’ve enjoyed them all. I hope more of you are participating in this monthly blog party started by Adam Machanic (b / t). Whether you write today, or you write at some time in the future, T-SQL Tuesday topics are good ways to showcase your knowledge.

    This month’s invitation comes from Jen McCown, of Midnight DBA. Jen asks us to write about managing an Enterprise of SQL Servers. That’s a good topic, since many of us struggle to manage multiple instances. Whether you have 5 or 500, there are some good ideas that you might implement in any environment, and I’m looking forward to reading what people have to say.

    Decoupled Consistency

    A long time ago I was thrust into the role of managing hundreds of SQL Server instances at a large company. I’d managed dozens of machines before, but this was a whole new level of scale. What’s more, the majority of machines were set up completely independently of each other, with no concerns other than a mandate to try and keep versions close to each other. That was a challenge in and of itself.

    The only common tool in use was Patrol, which was mainly used to monitor performance counters, but we didn’t have the SQL Server specifics, so we really could only get general performance counters, and even those were difficult to access when thousands of hosts were being monitored.

    I brought an idea with me from a previous job that had served me well with a handful of disparate instances. We’d consistently set up each instance, both installation, configuration, and monitoring, however we’d decouple each instance from others. Our goal was each machine capable of operating independently from all the others.

    We had found that central servers go down, that we had no good way of tracking the status from machines when this happened, and most importantly, there are always exceptions.

    With this in mind, we

    • built a procedure to install SQL Server, but included a number of scripts for post installation that would standardize settings. This allowed our server build people to easily handle SQL Server installation as part of their job. These days I’d use something like FineBuild to make this easy.
    • set up a DBA database on each instance that monitored jobs and other important status for the instance. If the instance was up and SQL Agent running, we’d know the status of that instance.
    • Performed basic monitoring of some key performance counters for a quick trend of the latest performance over the last week, similar to what SQL Monitor shows. Getting a quick snapshot was quicker than accessing central monitoring, especially in a crisis.
    • Assembled a report for the instance each day, calling out exceptions at the top, and leaving expected data below. We needed documentation for our ISO certification, and our auditors loved this.
    • We did use a central server to assemble the reports from all instances and compile them for the DBAs to review. All exceptions were at the top, and we used a left join to compare the list of instances with current reports. If any were missing, we bubbled that to the top as an exception.

    These were all good, simple ideas that allowed a team of 3 DBAs to manage 400-500 instances of SQL Server. We were flexible enough to handle the needs of mission critical Finance instances as well as often changing development machines. Our data was simple and always available for us to give to clients when they had questions.

    Most importantly, we built a system that allowed us to deal with exceptions, but not review the mundane stuff. Our time was precious, and that’s the case in any enterprise situation. You need to focus on the 10-20% of systems that really need regular attention while ensuring the other 80-90% of them are still being maintained.