Friday 14 August 2015

DBA Training Week 1: Where My Servers At?




Week 1: Build a Server Inventory

Brent here. At your company, walk into the VP of Sales's office and ask them how many salespeople they have.

NO, I mean, don't actually DO that, because he's going to ask you why the sales app is so slow. But I mean, imagine if you COULD walk into his office and ask him that. I bet he would have an instant answer. He wouldn't wait for a single moment. Or walk into the CEO's office and ask how many employees he has. Or ask the CFO how much the annual budget is.

My point is that when you're in charge, you need to know exactly what you're in charge of.

Make a Spreadsheet InventoryLet's start by making a spreadsheet. Across the top, make columns for:
  • SQL Server Version (2012, 2008, 2005)
  • Edition (Standard, Enterprise, Developer)
  • Environment (Production, QA, development, disaster recovery)
  • Department (sales, HR, accounting, IT, mixed use)
  • Business Users Affected (list of people to email when the server dies)
  • Application Names (internal or external product names)
  • Plan B
That last column gets a little tricky - it means, if this server dies in a fire, what's our Plan B? Are we going to restore the databases from another server? Will we fail over to a log shipped copy? Or will we update our resume and head out for an early lunch? As we go farther into the training, we're going to get much more specific about Plan B.

There's no wrong answers here - week 1 is about understanding where we're at today, not where we'd like to be. We're never where we'd like to be. (Me personally, I'd like to be at a poolside bar right now, but noooo, I'm in a hotel room waiting for my girlfriend to finish blow drying her hair. If you've ever wondered why I write so much, you can thank her full head of hair.)

If you'd like to get ambitious, add additional columns for Core Count, CPU Count, and Memory. The core and CPU counts will get you a head start on licensing, although I have to confess that we're not going to cover licensing as part of our training plan.

What We'll Do With This SpreadsheetRight now, you probably sleep well at night thinking you know everything that's happening in these servers. Hoooweee, have I got bad news for you. Over the next six months, we're going to progressively add more and more columns to this spreadsheet as we learn more about our environment, uncover problems, and learn how to solve them.

For bonus points, add a column for What Scares Me. Write a quick note about the one thing that scares you most about this server. Maybe it's blocking problems, maybe it's the failing jobs, maybe it's code you don't understand. Six months from now, I bet you'll be proud of how this column has changed.

How to Survey Your Network for ServersPut a row in the spreadsheet for every server you have - whether you're in charge of it or not. We want to start with a good inventory of what we have, and there's two good free tools to do it.

Microsoft Assessment and Planning Toolkit - it's actually designed for licensing compliance, but it works great for building server inventories. It scans your network looking for whatever programs you pick, but just confine it to SQL Servers only.

Dell Discovery Wizard for SQL Server - it's a GUI tool that pings all the servers in your network and tries to figure out if they've got SQL Server installed. If you're in a small shop where your account has admin privileges in the domain, you might find a lot more servers than you expected.

SQL Power Doc - open source PowerShell scripts to discover, document, and diagnose your SQL Servers. I'm not gonna lie: this one is not for the faint of heart, but if you're willing to get your hands dirty and deal with some manual work, the end result is a nice set of Excel spreadsheets.

We don't get paid for plugging these products, and we're always on the lookout for similar inventory-building tools, so if you know of a better one, email it to Help@BrentOzar.com. See you next week!

Brent Says: When you take a new job as a DBA, the very first question you should ask the company is, "Do you have a list handy of all the SQL Servers I'll be managing? I don't have to see the list - I understand if you have security concerns - but I just want to know if that list exists."

Most of the time...it won't.

This question serves two purposes: it tells YOU if the company has their act together when it comes to documentation, and it tells THEM that you're the right person to manage their database servers. If they don't have the list, they're going to want that list right away. Now's your chance to explain how you would go about gathering that information (armed with the info in this email.)

Bonus points: create a SQL Server Support Matrix, a document that explains for your developers and end users what's allowed in production, DR, QA, and development. This helps set expectations going forward - if a server's going to be production, then it has to be stable, and that means making sure changes don't happen accidentally.

I created that sample support matrix when I worked at Southern Wine & Spirits as a DBA, and I've shared it so you can do a save-as and get a fast start on your own. Hope that helps!


No comments:

Post a Comment