My romantic relation with Powershell generally and DBATools especially
summary
Live demo shows using the DBATools module and PowerShell to provision two Docker SQL Server 2019 instances (sql1, sql2), create a dba database, install Ola Hallengren and First Responder Kit, and automate backups to Azure Blob by creating SQL credentials with a SAS token and running backup to URL. Jobs run hourly fulls and log backups every minute. A home‑grown log‑shipping loop reads get‑dba‑db‑backup‑history, restores with NORECOVERY, tracks LSNs in a watermarks table, and uses copy‑dba‑login / copy‑dba‑agent‑job; all of this is demonstrated end‑to‑end in about 45 minutes.
AI-written summary · about
chapters (11)
- 0:00Start
- 2:54create your own azure storage container
- 5:56get the development branch from the dba tools
- 10:56create a login
- 11:52put all the parameters to a command into a hash table
- 14:24store the backups in an azure storage container
- 14:45back up your databases to an azure storage container
- 16:14create the credential objects in a sql server
- 31:54copy the logins from one instance to another
- 32:36the copy dba login
- 37:35start the log shipping sequence
related talks
44mAnthony's Favorite dbatools cmdlets and Use Cases
20mSQL Server 2022 migrations with dbatools
48mManaging replication with dbatools
39mDatabase DevOps with Containers
46mLift and Shift with dbatools - Azure SQL Managed Instance edition
44mContinuously deploying SQL code using Powershell
01h 09mAzure SQL Database Development Inner and Outer Loops
50mA Deep Dive into DevOps Practices with Azure SQL
