DevOps for the DBA, Slide Deck

DevOps
I have an all day seminar I give called "DevOps for the DBA". If you're attending, thinking of attending, or you have attended, you might want to have the slide deck to review. I have published it here at SlideShare.Net. Fair warning. The slides are not the presentation. When you're attending a class that I teach, you're there for the live, in-person, interactive event of the training. The slides are not meant to be documentation. They are simply guideposts to keep me on track and to help illustrate certain points. If they are helpful to you, I'm happy to share. I just want you to know that reading through the slides can in no way be a substitute for actually showing up. If you would like to attend this seminar,…
Read More

Implement DevOps One Step At a Time

DevOps
In preparation for my upcoming DevOps training days (see the bottom of this post for details) and for some articles I'm working on, I've been building all new automation processes for database deployments. In the past, I've been using a fairly simple (and far too simplistic) example to do most of my demos. I haven't built a full process in a little while. OH MY GOD!!! IT'S PAINFUL!!!!! Automation Ain't Easy The easy part of getting your DevOps done is the tooling. I say that all the time because it's true. The hard part is changing your organizations culture to support the level of communication necessary for a successful DevOps implementation. However, easy by comparison doesn't mean just simply easy. There's a lot of work involved and making mistakes early…
Read More

DevOps and Automation Will Eliminate the DBA

DevOps
I've been reading about the death of the DBA ever since I first made the jump from full time developer to full time data professional. The first time I heard it was when SQL Server 7.0 was released. Did you know that SQL Server 7.0 was self-tuning? In fact, it was so self-tuning that the DBA is a relic of the past and no one will be paid for that kind of work any more. Right. So, twenty years later, several versions of SQL Server with tons of improvement from back in the day, and I'm still working (and I hope you are too). Object databases were going to eliminate the DBA. ORM tools were going to eliminate the DBA. Then of course, NoSQL absolutely eliminated the DBA. In fact,…
Read More

PASS Summit 2017

Azure, PowerShell
Don't you want to go to the single largest collection of Microsoft Data Platform professionals and developers on the planet? Sure you do. PASS Summit 2017 is coming up. Now is the time to register for this unique event. This year I've been honored to be able to present a session at the PASS Summit. It's on three subjects that are very near and dear to my heart, automation, PowerShell, and the Azure data platform. The session is called Using PowerShell to Automate Your Azure Databases. It covers a lot of material from controlling your Azure SQL Databases to creating Azure SQL Data Warehouse databases to automating maintenance. We'll even get your Azure PowerShell installed & working locally. I'm very excited about this and I sure hope to see you…
Read More

Alerts From Azure Automation

Azure
In a previous post, I showed how to set up statistics maintenance for your Azure databases using Azure Automation. However, what I didn't show was how to generate an alert when things go south. Let's do that now. An Error Needing an Alert First, I need to generate an error. I'm going to modify the code just slightly from the previous example so that it will fail: $Cmd=new-object system.Data.SqlClient.SqlCommand("UPDATE STATISTICS dbo.TableNotInDB", $Conn) If I modify my Runbook with the code above and then run it, I will get an error: This is from the test pane. I strongly recommend you use tests on your PowerShell scripts when writing your own automation. It'll save you a lot of pain trying to troubleshoot things later. Alert on Error Believe it or not,…
Read More

Scheduling Statistics Maintenance in Azure SQL Data Warehouse

Azure
The power and capabilities of Azure SQL Data Warehouse are pretty amazing. However, it's still basically SQL Server under the covers. SQL Server still needs maintenance and one type of maintenance is keeping statistics up to date. Statistics maintenance is doubly important within Azure SQL Data Warehouse because statistics are not created automatically, nor are they maintained automatically. It's up to you to ensure your statistics are up to date. Statistics in Azure SQL Data Warehouse It's worth re-emphasizing the point that there is no automatic creation of statistics in Azure SQL Data Warehouse. This means you need to plan to add statistics to your tables. Microsoft recommends an easy method is to add them to every column. While that does make things easy, it's not like statistics are free. If you…
Read More

Azure Automation

Azure
I introduced Azure Automation in a previous post. I've spent some more time exploring it. There's a set of documentation available as I noted before. Unfortunately, reading through the full set of documentation, I have some criticisms to offer. The layout of the documentation goes through "Common runbook tasks" actually more or less laying things out as I did, inadvertently, I assure you, in my previous blog post. The problem with that, as I found in that post is, the administration of the runbooks seems fairly straightforward from the screens. But, you can't do a darned thing with any of it until you have a runbook . Further, you can't have a runbook until that thing has some code in it. And, the documentation doesn't include documentation about code. Instead,…
Read More

Microsoft Azure Automation

Azure
Microsoft just announced a new mechanism for managing your Azure resources, Automation. You can check out the documentation on it here. It's a mechanism to create runbooks using PowerShell that you can then combine with other runbooks inside a runbook, etc. Let's check it out. I'm doing everything you see here without consulting the documentation. I want to see how easy it is to put this stuff together. First, because it's still in preview, you have to sign up. Once you're accepted in the program, you get a new icon in your Management Portal. Next, you'll have to create an automation account. That's pretty straight forward. It's just a name, your selected region and the subscription you're putting it under. No immediate guidance on where, when or if the region matters that…
Read More

Book Review: The Phoenix Project

DevOps, Professional Development
Let's get this straight right up front, the thought of reading a novel that's about IT is so repellent, so repugnant, just so horribly wrong, that it's kind of hard to fathom why I would even attempt it. What's even more difficult for me to fathom is how much I enjoyed this book. Which is a novel. About IT. I can't figure it out. Maybe I need to start reading more IT novels... no. Let's hope that's not actually a thing. On with the review... The Phoenix Project is a story about a mid-level manager in a large company who has been running part of the IT organization that is a bit of a backwater, maintaining old big-iron systems, VAX, that type of thing. He gets called into the CEOs…
Read More

SMO vs Invoke-Sqlcmd in Azure

Azure, PowerShell
I'm working on a series of Powershell scripts for the pre-conference seminars on Windows Azure SQL Database that I'm going to be giving at TechEd and the PASS Summit. One of the things I want to do is script out a full backup process (one that's consistent with transactions) which means I need to create a database copy. There's a nice neat T-SQL command that does this: CREATE DATABASE ADW_COPY AS COPY OF nmhdhskcew.AdventureWorks2012; So, being the lazy Powershell freak that I am, I figured I'd just pass it in with Invoke-sqlcmd as a single line like this: Invoke-Sqlcmd -ServerInstance $server -Database $db -Username $user -Password $password -Query $sql Which resulted in an unexpected error: Invoke-Sqlcmd : The CREATE DATABASE statement must be the only statement in the batch. Well, now I'm curious.…
Read More