Oct 14 2015

Getting Started With DocumentDB

I’ve put this off for too long. It’s time to get my feet wet with some new tech.

Step 1 is easy. Go to the Azure portal and start the process for creating a DocumentDB:


While that’s running, let’s see what’s on the interwebs about getting started in DocumentDB…

Nice. I know I’m going to have write a little code to exercise this thing. Here’s a great run-through on exactly how to do it. Actually, the first hit when I searched on “Getting Started With DocumentDB.” Microsoft has a start page on DocumentDB, but it was clearly put together by someone from marketing. Scroll down to the bottom. There are a couple of interesting links including SQL Query Within DocumentDB. Now we’re talking. Here’s a Curah! or Docs.com (which is it? do I care?) on DocumentDB with some of the above links and a few others. I spot a theme on this one. Here’s a more thorough how-to on querying DocumentDB.

Plenty to read, lots to do. And look, I have a DocumentDB database ready and waiting:


I’ll report back as I get things going.

Jun 30 2015

Leadership Training Possibility

I know a few people in the SQL Server community who have been involved in Scouting. A couple of them have taken or helped lead Scoutings leadership training program known as Wood Badge. It’s an amazing program. I won’t even attempt to tell you what Wood Badge has done for me and what it does for Scouting. Suffice to say, Wood Badge helped to make me a better person and in return, I helped make Scouting better.

What’s this have to do with SQL Server? Not much really. But, what does it have to do with you and your career? Tons.

It was pointed out to me that there’s an Oracle users group that actually runs a leadership program. You can read about it here.

It strikes me that, maybe this is something we in the SQL Community ought to have. I’m posting this to see what kind of interest there is, if any. So if you regularly just read this blog and never post, sorry, today is the day it’ll really matter if you respond. So please, read through my general thoughts and let me know what you think.

First up, this needs to cover generic leadership principals such as vision, planning, communication, goals and measures and all the rest. It’s not about management. It’s about leadership. These are different and will be differentiated. This also has to have available some mentors, people who volunteer to monitor & guide attendees through the process. There will probably also be volunteers leading the classes, possibly independent of the list of mentors, we’ll see. Additional training would be on, well, easier to say what it won’t be on. It won’t be on speaking, technical stuff of any kind, or any company or technology. Instead, it would be about leading, maybe community building, running a user group, setting up and running an event, that sort of thing. It’s not going to be a single class. It’s going to take time. Let’s say, somewhere between 6 months to a year of commitment to the leadership courses (done remotely, anything else is too insane for me to consider managing) and then another 6 months committed to delivering on your project(s). And yes, this means that there will be an expected amount of work to be delivered as part of the whole thing. I’m not suggesting holding a class and then printing out certificates. I’m suggesting something similar to Wood Badge, something that you would be proud to put on your resume, something you’d be clamoring to help out with after you complete it. One more thought, it would be best if we could get an organization to back it. Barring that, we’d need to create an organization to back it. There would probably have to be a charge for this, and not a trivial one either (I haven’t thought it through, but let’s say more than $500, less than $5000, figure it out as needed). It won’t be open to anyone. I suppose an open call for application, but since it requires commitment, it might be invite only. Something to talk about. It needs a name.

This is not a course outline or an abstract. It’s really just a stream of thoughts to act as the starting point towards building a structure. My question to you is, what’s the interest? Please post. If I get my usual three responses, I’ll just write this off as an idea that won’t fly and move on.

Apr 16 2015

Azure SQL Database v12 and SQL Magazine

I spend many of my evenings researching and writing. Sometimes it’s writing new books. Sometimes it’s fixing and rewriting old books. Occasionally it’s a blog post like this one. Lately, it’s been a series of articles for SQL Magazine that are all about the new functionality available in Azure SQL Database v12 that was released in February for most data centers in Azure. It’s a whole new ball game. Check out my introductory article for v12 and the one on DMVs in Azure. I have more coming up on CLR in Azure, getting started, PowerShell, DBCC, T-SQL enhancements, Premium Tier and more. I’ll also get into “old” functionality like backup and restore. I’ll also explore new functionality, Azure is nothing if not dynamic, as becomes widely available.

I know a lot of you have been putting off exploring Azure, especially Azure SQL Database until it was “ready.” Guess what? It’s that time. Feel free to lean on me here, and over at SQL Mag, for questions, suggestions, thoughts, concerns, anything you have about Azure.

Mar 19 2014

Query Tuning Near You

It really is so much easier to just throw hardware at badly performing databases. Just buy a bigger, faster server with more and faster disks and you can put off doing tuning work for another 6-9 months, easily. But, for most of us, sooner or later, our performance problems get so big or, we just don’t have any more money to spend, and we’re stuck. We have to tune the queries. And frankly, query tuning is a pain in the nether regions.

But, after you’ve tuned queries 20 or 30 times, you start to recognize the patterns and it gets easier (never easy, just not as hard). But, if you haven’t done it 20 or 30 times, what do you do? My suggestion, talk to someone who has done it 30 times (or even a couple of hundred times), like me for example.

I have an all day session on tuning queries. It goes from understanding how the optimizer works (which will automatically lead you to write better queries), to how to gather performance metrics (so you know where the pain points are located), to reading execution plans (you need to know what has gone wrong with the query) to various mechanisms for fixing the query. This information is applicable to systems from SQL Server 2005 to SQL Server 2014 (sorry everyone still on 2000, it’s time to upgrade). The session is based on the books I’ve written about query tuning and execution plans, plus years and years of doing lots of query tuning.

Right now I’ve got two events scheduled. Before SQL Saturday #286 in Louisville, KY, I’ll be putting on this precon. We’re limited to seating, so don’t wait. You can go here to register. Then we can get together the next day at the SQL Saturday event to get some more education from all the great speakers there. Next, before SQL Saturday #302 in Albany, NY (their first one, ever), I’ll be hosting this. You can register by clicking here. Don’t miss the early bird special. Again, the next day will be filled with learning at the SQL Saturday event.

I’m working on taking this to other locations and venues. If you’re interested, please get in touch. I’ll do what I can to come to you.

If you have a particularly thorny query, bring it along with an actual execution plan. If we have time at the end of the day, I’ll take a look and makes suggestions, live (uh, please, no sensitive patient data or anything like that).

Let’s get together and talk query tuning.

Feb 26 2014

SQL Intersection, Spring 2014

I am terribly jazzed to be involved with this amazing event, SQL Intersection. It’s featuring some truly amazing speakers presenting on important topics. It’s being held here on the East Coast, right near the Mouse, the Duck and Dog. This is one of those conferences you need to get to. Check out the lineup. That is some of the smartest, most capable people I know. I’m quite humbled to be on the list with them, so I’ll do my level best to deliver good content. Look at the sessions. While I don’t know precisely when SQL Server 2014 is coming out, I’m sure it’s real soon, so this will be a great place to get a leg-up on understanding what this new set of technology offers, or just learn more about SQL Server in general, Azure, SSRS and SSIS.

Click here now to register for this special event.

Oct 22 2013

SQL in the City, US Tour 2013, Recap

WP_20131009_004Red Gate visited three cities this year with our SQL in the City event; Pasadena, Atlanta and Charlotte. I just wanted to give you a quick assessment of how the events went from my point of view.

Overall, each and every one of these events was awesome. I can safely say that because each and every one of these events provided something special, the opportunity to network with our peers and with the developers and project managers at Red Gate (who are also our peers, but not usually available to us). I both took part in the networking and stood back and watched it happen. I love seeing a bunch of data pro’s sitting (or standing) in a circle exchanging war stories, ideas, questions, thoughts or suggestions. It means you are building your skill set by extending your network. I saw cards, email and web addresses exchanged. That alone made these events a raging success.

But, it got even better. I also took part in  lots of discussions about how people are using Red Gate software to make their jobs easier. I saw lots of people talking to the developers and project managers. This means you’re very likely to see new and better solutions coming out of Red Gate to make your lives a little easier. The opportunity to provide feedback is one more reason to attend an event like this. The ability to interact with people that are building the tools you use in order to supply them with the information they need on how to make that tool better serve your needs is the kind of opportunity that should never be ignored. It’s one of the reasons I encourage people to go to the Microsoft booth at PASS or TechEd and to visit the SQL Clinic at PASS. You don’t get that many chances to talk to the guys who can directly help you. But we provided that at SQL in the City. Another huge success.

Oh yeah, and there were learning opportunities through presentations in sessions. In addition to talks from Steve Jones, Red Gate developers and me, we had guest speakers helping us out. Mickey Steuwe (b|t) did a session in Pasadena and Charlotte on “Improve Your T-SQL by Changing Your Writing Habits.” Oh, and somehow you attendees got real confused and more of you went to Mickey’s session than to mine. Let’s keep an eye on that (ha! Kidding). Also in Pasadena Ike Ellis (b|t) gave a session called “SQL Server Tips and Tricks.” In addition to that, Ike sat down and walked me through his version of my talk on database deployments. I think Ike’s version of the talk was better than mine in a lot of ways. We may need to get Ike in to give that session. Trust me, you’ll like it. Finally in Pasadena, Ernest Hwang (b) gave a session called “Database Build and Release.” I’m sorry to say I missed the opportunity to meet Ernest.

Atlanta saw a different group of speakers. The touring speakers were the same, but we also brought in Tim Radney (b|t) for a session called “Life as a DBA.” Stuart Ainsworth (b|t) was also in Atlanta doing a session, “Simplifying SQL Development.” Both these guys are good friends and I loved hanging out with them. I have to say, I really like how Tim has his kids cut their hair. You should see the girls (kidding again).

In Charlotte we were able to pull in more speakers. Mickey again (although it’s unclear who had more people this time) with her session. I have to watch this session at some point because it sounds interesting and Mickey is a very good presenter (although, having spent a year as her mentor, I’m not in any way, shape, or form, prejudiced). We got one of my favorite speakers, and writers, Louis Davidson (b|t). I’ve followed his stuff for years and can’t recommend him enough. His session was “Database Design Fundamentals.” Kevin Boles (t), Ex-Navy Nuke O-ganger but still a good guy, did a session called “Windowing Functions: The Reason to Upgrade to 2012.” We also got to have Nigel Sammy (b|t) do a session on logs and backups which I actually got see. It was great. So if you get the chance to check out “Understanding and Controlling Transaction Logs” I can recommend that. Finally Kevin Hazzard (b|t) did a session called “Schema Change Management.”

At the end of each day we had an extended networking session including some networking lubricant (frothy beverages) which is always good.

I’d be remiss if I didn’t point out a few things that didn’t go well (although I’ll take a beating for this later). I hosted my first panel discussion in Pasadena and I really messed it up. I won’t be at all surprised to find it at the bottom of the ratings. I’ll prep better next time and will control the experience more directly. I should have had my own canned questions instead of constantly berating the audience to ask us stuff. Huge error.  I didn’t think lunch went all that well in Atlanta, but it was because the venue was kind of awkward to navigate creating some long lines. These things sometimes happen, but you try to avoid them. I also think my session on automating DBA tasks had just too much material in it, so I was skipping by information that people may have wanted to see. Better to offer less and deliver it than offer more and dance on by. I’ll work on that one if we decide to give it again.

IMG_7124In short, except for some small issues, I thought all three events were simply amazing. I do think the Charlotte event stood out. The venue was simply incredible. The audience, well-sprinkled with experienced PASS Summit attendees (although, only about 1/2 the audience was even going to attend the Summit and, about 1/4 of the audience wasn’t aware that the Summit was going on down the street), was very prepared to engage the speakers directly (which, at least in my opinion, makes sessions much better) with questions, comments and suggestions. Plus, I was already working on a very good SQL Family high that had been building up all week, so maybe I was a little prejudiced.

Thank you to each and every attendee at all three events. I know the organizers practically killed themselves in putting together the event. The speakers worked extremely hard prepping their material. But you make or break an event. You absolutely brought your A-game making these events wonderful.

You’ll be able to track down slides, possibly videos and audio, all at the SQL in the City web site. Thanks again. Pretty sure we’ll be at a new set of cities next year. See you then.

Sep 10 2013

New Windows Azure Virtual Labs

Getting started with new technologies can be a pain. That makes all the new labs that Microsoft just posted extremely useful. There are several that are going to be immediately applicable to your average data pro; Introduction to SQL Database, Connecting a PaaS Application to an IaaS Application with a Virtual Network, Web Sites and Virtual Machines using ASP.NET and SQL Server. The beauty of these things is that you don’t need to do anything to get started. These are virtual machines hosted out on the cloud that you get access to. Further, you’ll get a lesson plan to follow so you’re not left floundering. You will have to either connect your MSDN account to set up an Azure account or, if you don’t have MSDN, sign up for an Azure account. But, get that done and you have things to learn from.

Aug 22 2013

Get Started with Windows Azure SQL Database

CommentsLearning new things can be daunting. First, you have to come up with the spare time. Then you have track down resources. For computers, computing and programming, this is both extremely easy and extremely difficult. That difficulty is especially true when it comes to gathering resources for learning things that, while you learn, are potentially going to cost you money. It’s a difficult decision to make to risk cash on exploring a new technology. Here’s the good news, for several reasons, you don’t need to sweat this to get going with Windows Azure SQL Database (WASD).

A couple of years ago Jamie Thompson (b|t) set up an account on Azure, all on his own, that allowed people to connect up to it and play with a copy of the AdventureWorks database. This year, the company I work for, Red Gate Software, took over maintaining that database as a community service (meaning, it’s free). You can go here to learn all about how to connect up to AdventureWorks in WASD. You can connect right through SQL Server Management Studio from your own PC. Try running a few queries. See what happens when you generate an execution plan. See which of the Dynamic Management Objects you might have access to. In short, start learning. It won’t cost you a dime. But please, leave a message by running an INSERT statement to the dbo.SqlFamily table. I posted some of the recent comments in the graphic.

Pain and cost free. You’re not only able to tool around and begin to understand what is offered by WASD, but you’re immediately seeing the hybrid nature of managing data in this new paradigm. That data is out in Azure, but you’re querying it from SSMS on your desktop.

Let’s say you already have an Azure account but you just don’t feel like setting up a database, all that work… I get it. Good news. Scott Klein (b|t) has created a copy of AdventureWorks just for use with Azure. He’s published it out on Codeplex, so it’s easy to track down. Check it out and see if it doesn’t help you get started with WASD.

Did that get you hungry for more? Cool, let’s stick to free(ish) opportunities. Do you, or your employer, already pay for an MSDN license? Then, depending on the license level you have up to $150 in credit available to you in an Azure account that is limited to that credit amount and no more. That’s right, it’s free (as long as you’ve already paid for MSDN) and you can’t rack up charges because it stops all service when you hit your credit limit. Further, you don’t have to enter a credit card either. It’s a perfect way to start learning WASD. Not only WASD, but all the rest of Azure, especially Azure VMs. Did you know that you can spin up an Azure VM that will run SQL Server 2014 on a SQL Server 2012 R2 server? What’s that? Those aren’t released yet? You’re right of course, but you can get access to VMs with these running on them to start learning the changes that are coming your way and it’ll only take about 5 minutes to get set up. I detail how to do it here.

To link your MSDN account and your Azure account, follow this link. It will also enable you to get a chance to win a rather snazzy car. Win a car and expand your skill set, all at no additional cost to you. That’s a deal.

With all the money I just saved you, you can register for my all day pre-conference seminar at the 2013 PASS Summit where I’ll be teaching WASD, Azure VMs, Failover, Virtual Networks, Deployments, Troubleshooting, anything and everything about managing data within the relational offerings available through Azure. Go here to register.

May 09 2013

Book Review: Business in the Trenches

I’m trying to improve.

That’s at just about everything too. I know I don’t know enough or have enough skills to always get things done in an efficient manner, so I’m trying to learn more. One way is by reading, a lot. I’ve read a number of management and leadership books, many of them reviewed on this web site. I just finished the book Business in the Trenches. I really enjoyed it. It combined two of my passions, self-improvement and history, specifically history of World War I. Now, this is a tech, community and business blog, so I won’t go on & on about the Great War (although I could if you wanted). Instead, I simply want to provide you a link to my review of this book. It really is a worthy read that teaches important lessons in a fun and interesting way. That made me want to be sure that you all had the opportunity to learn about it.

Dec 03 2012

HDInsight, Finally

See this:

That’s right. The install worked. All I had to do was get a completely clean server set up. No domain controller. Now to get my learn on.

Microsoft has a web site with a number of introductory samples. I’ll start there and work through them. The very first example gets me set up with some data that it builds by running a Powershell script, importdata.ps1. But I’m not going to just blindly follow along. I want to see what the heck is happening so I can start understanding this stuff. By the way, thank you Microsoft for making the samples in PowerShell and not forcing me to relearn Python or something else. That would have been frustrating.

The script is really simple. It has two scenarios you can pass it, w3c or RunTraffic. They just change directory and run another PowerShell script, import.ps1, from two different directories. I’ll be the scripts are different. I’m running the w3c scenario, so let’s see what that script is doing.

Ah, now things are getting interesting. There are two functions, one for data generation which uses an executable to make up test data. The other a mechanism for calling Hadoop. Basically it uses two objects, System.Diagnostics.ProcessStartInfo and System.Diagnostics.Process. The ProcessStartInfo is for defining startup information for a process that you then define using the Process command. In this case it’s setting the location of hadoop:

$pinfo.FileName = $env:HADOOP_HOME + "\bin\hadoop.cmd";

Then it sets up arguments, if any. The actual calls to this from the code use a command, dfs, which has different settings -mkdir and -copyFromLocal. From what I can tell, it’s creating a storage location within Hadoop and then moving the data generated over. I’m good with all the scripts I can see except knowing where this dfs thing comes from.

Data load ran just fine:

Data loaded, time to test out a Map/Reduce job. Again there’s a powershell script included for running a simple job, so I check it out. First run, fails. Great. More stuff to try to troubleshoot in order to be able to see this work. This is not going to be easy.

Stepping through and running the scripts might not be the best way to learn this. So, I’m going to now start reading the Big Data Jumpstart Guide. I’ll post more as I learn it.