T-SQL Tuesday: The Cloud, Globalization and Automation
Today's blog post is part of T-SQL Tuesday. T-SQL Tuesday is the brainchild of Adam Machanic. It is a monthly blog party on the second Tuesday of each month. Everyone is welcome to participate.
This month’s T-SQL Tuesday, hosted by Koen Verbeeck (blog | twitter), is all about how technology has changed a lot in the past years and the potential impact these changes will have on SQL Server Pros.
In Koen's invitation, he specifically called out the cloud, globalization and automation.
When it comes to the cloud, I think on-prem is still a safe bet and will be for at least another decade.
My first bill from Amazon Web Services arrived nearly ten years ago on June 1, 2007 (it was for $0.61, not bad). Since then, I've played in the cloud off and on, and was even the technical editor for a book about Automating Microsoft Azure with PowerShell. When it comes to work work, however, everything is still on-prem. Similarly, my awesome homelab is tucked safely in a storage room at my house.
Ultimately, when it comes to the cloud, I think it'll be at least another 10-15 years before a majority of organizations fully move away from on-prem. And as they do, I'll go along with them, but like many organizations, I'm in no rush. The "Datacenter" in my Cloud and Datacenter Management MVP is strong.
At the same time, I know that my varied systems background lends itself to the confidence that I can adjust to cloud movement with no issues. I'd encourage DBAs with a weak systems background invest more time into understanding their whole environment and not just SQL Server itself.
Is this offshoring? If so, I've seen situations where it's worked, and situations where it hasn't. I'm not really concerned.
Y'all know what I'm gonna say here! I love automation and PowerShell. I know for a fact that PowerShell and T-SQL together are the future of SQL Server administration. As someone who often presents about dbatools, the popular SQL PowerShell community project, I've seen the excitement and relief that PowerShell automation brings to SQL Server Database Pros.
For years, I've used Ola Hallengren's Maintenance Solution, but I always found it stressful to know that at each location, I'd have to spend a chuck of time working on the process to perform restores as required.
A whole instance of Ola backups
What happens if an entire instance goes down? Now, thanks to Stuart Moore, restoring the most recent database backups to another instance is as easy as
Get-ChildItem \nas\sql\sql2016 | Restore-DbaDatabase -SqlInstance sql2016a -MaintenanceSolutionBackup
What about logins with their passwords, SIDS, permissions and all that? I export every login within my estate every day to a text file using Export-SqlLogin.
What about jobs? Well, we don't export those yet, but they're on the list ;) Here's a video of Restore-DbaDatabase to keep you occupied in the meantime.
We also have a quick 5 minute video that gives a tour of the four SPN commands.
Ever needed to find a stored procedure that contains specific text? When I did development, I had to all the time. dbatools offers an easy, awesome way to do this. You can even search using regular expressssssions! What?!
And it's smoking fast, too. I once evaluated 37,545 stored procedures on 9 servers in less than seconds!
In conclusion, automation is life
Intrigued? Check out our whole catalog of commands that automate common (and not so common) SQL Server tasks.
Thanks for joining me for this month's T-SQL Tuesday.