Let’s have a look at restarting, pausing or resuming an Azure Synapse Analytics SQL Pool database using PowerShell. The PowerShell scripts are quite useful. I built a wrapper to perform all the operations.
I recently found myself working on a project where restarting the Azure Synapse Analytics SQL Pool (aka Azure SQL Data Warehouse) was a requirement to solve some performance issues. I also believe that it’s good practice to restart it. The activities in the compute nodes are intensive and generate many logs.
With this script you can perform any of the following activities:
Download the Script
The script is available through the following link:
Before you can run the script, you need to download the Az Module and log into the Azure tenant. In upcoming blog posts, I’ll show you how to use an automation account.
Install Az Module
Install-Module -Name Az
Connect to Azure
Execute the Script
The script has 4 mandatory parameters:
- ResourceGroupName: resource group name where the server is being hosted
- ServerName: server name that needs to be restarted
- DatabaseName: database name that needs to be restarted
- Operation: Start/Pause or Restart
.\Restart-AzSynapseSQLPool.ps1 -ResourceGroupName "YourRGName" -ServerName "YourSQLServerName" -DatabaseName "YourDatabaseName" -Operation "Pause"
In this post, you’ve learned how easy it is to start using PowerShell scripts to manage your database.
In upcoming posts, I’ll show you how to include this script in an Automation Account.