My Specialty

So I was reading the following blog post by Brent Ozar and I think it finally hit me right between the eyes.

I think from a DBA perspective I would have to consider myself in the DevOPS realm, but more generally, I am an automation specialist. It’s what I truly love to do and where I shine. Whether it’s a simple information gathering exercise, or deploying database code, I enjoy automating it. Automation brings simplicity, scalability, consistency and reliability to a potentially complex process.

As a DBA I get to work with servers, operating systems, virtual machines, networks, storage, applications, services, people who specialize in all of these other disciplines, and oh yeah, I get to work with databases too. So yeah, there is a ton of opportunity for automation because being a DBA involves so much more than just databases and running SQL statements all day.

As a bit of an aside, I have a lot of experience with unix and Oracle from my past life, but for the past 7 years I have been working exclusively as a SQL Server DBA. In unix I had ksh, bash, perl, awk, sed, the list goes on and on. I always had a tool to do what I needed. When I first started working on the Windows platform I was a bit disappointed. The scripting environments weren’t very good. I’m sure the old timers will disagree, but coming from unix where I had script language overload, Windows failed to deliver. It wasn’t until PowerShell started taking hold that I started to warm up to the environment. With PowerShell 5.0 on the horizon I will say that the Windows platform has come a long way in terms of automation.

I live by the mantra, “Script Everything”. Yes, everything. Even if it’s just a 1 or 2 line script, save it off. You never know when you will need it again. So many times I will get an email from a colleague asking me for some information.

Here is a simple example: “Hey. Can you get me a storage report for all databases across all of our servers?” No big deal, right? Except we have tens of thousands of them. Doing it manually would be very time consuming and impractical. For me, the first thing I do when I get a request like this is to open the PowerShell command prompt or the ISE and start working on a script. But that’s just the tip of the iceberg as to what you can accomplish.

PowerShell really has become my main tool for automation in the Windows world. The best thing about it is that it is built on .NET, so it is easily extensible. There are modules for just about anything and everything out there. I frequent the SQLPS module which gives me all of the functionality of the SSMS interface through PowerShell cmdlets. If you have been putting off learning PowerShell don’t wait much longer because the rest of the industry isn’t waiting for you. Stop doing the mundane tasks. Stop being a point&click drag&drop administrator. Working that way doesn’t scale and unless you start growing new arms, either do you.

The next time some gives you what appears to be a simple task, try to script it. Do your self a favor and start diving in.


See also