Restore a deleted dedicated SQL pool (formerly SQL DW) in Azure Synapse Analytics
In this article, you learn to restore a dedicated SQL pool (formerly SQL DW) using either the Azure portal or PowerShell.
Before you begin
Note
We recommend that you use the Azure Az PowerShell module to interact with Azure. See Install Azure PowerShell to get started. To learn how to migrate to the Az PowerShell module, see Migrate Azure PowerShell from AzureRM to Az.
Verify your DTU capacity. Each dedicated SQL pool (formerly SQL DW) is hosted by a logical SQL server (for example, myserver.database.chinacloudapi.cn) which has a default DTU quota. Verify that the server has enough remaining DTU quota for the database being restored.
Restore a deleted data warehouse through PowerShell
To restore a deleted dedicated SQL pool (formerly SQL DW), use the Restore-AzSqlDatabase cmdlet. If the corresponding server has been deleted as well, you can't restore that data warehouse.
- Before you begin, make sure to install Azure PowerShell.
- Open PowerShell.
- Connect to your Azure account and list all the subscriptions associated with your account.
- Select the subscription that contains the deleted dedicated SQL pool (formerly SQL DW) to be restored.
- Get the specific deleted data warehouse.
- Restore the deleted dedicated SQL pool (formerly SQL DW)
- To restore the deleted dedicated SQL pool (formerly SQL DW) to a different server, make sure to specify the other server name. This server can also be in a different resource group and region.
- Verify that the restored data warehouse is online.
- After the restore has completed, you can configure your recovered data warehouse by following configure your database after recovery.
$SubscriptionName="<YourSubscriptionName>"
$ResourceGroupName="<YourResourceGroupName>"
$ServerName="<YourServerNameWithoutURLSuffixSeeNote>" # Without database.chinacloudapi.cn
#$TargetResourceGroupName="<YourTargetResourceGroupName>" # uncomment to restore to a different server.
#$TargetServerName="<YourtargetServerNameWithoutURLSuffixSeeNote>"
$DatabaseName="<YourDatabaseName>"
$NewDatabaseName="<YourDatabaseName>"
Connect-AzAccount -Environment AzureChinaCloud
Get-AzSubscription
Select-AzSubscription -SubscriptionName $SubscriptionName
# Get the deleted database to restore
$DeletedDatabase = Get-AzSqlDeletedDatabaseBackup -ResourceGroupName $ResourceGroupName -ServerName $ServerName -DatabaseName $DatabaseName
# Restore deleted database
$RestoredDatabase = Restore-AzSqlDatabase –FromDeletedDatabaseBackup –DeletionDate $DeletedDatabase.DeletionDate -ResourceGroupName $DeletedDatabase.ResourceGroupName -ServerName $DeletedDatabase.ServerName -TargetDatabaseName $NewDatabaseName –ResourceId $DeletedDatabase.ResourceID
# Use the following command to restore deleted data warehouse to a different server
#$RestoredDatabase = Restore-AzSqlDatabase –FromDeletedDatabaseBackup –DeletionDate $DeletedDatabase.DeletionDate -ResourceGroupName $TargetResourceGroupName -ServerName $TargetServerName -TargetDatabaseName $NewDatabaseName –ResourceId $DeletedDatabase.ResourceID
# Verify the status of restored database
$RestoredDatabase.status
Restore a deleted database using the Azure portal
Sign in to the Azure portal.
Navigate to the server your deleted data warehouse was hosted on.
Select the Deleted databases icon in the table of contents.
Select the deleted Azure Synapse Analytics that you want to restore.
Specify a new Database name and click OK