在 Azure Synapse Analytics 中还原已删除的专用 SQL 池(以前称为 SQL DW)Restore a deleted dedicated SQL pool (formerly SQL DW) in Azure Synapse Analytics

本文介绍如何使用 Azure 门户或 PowerShell 还原专用 SQL 池(以前称为 SQL DW)。In this article, you learn to restore a dedicated SQL pool (formerly SQL DW) using either the Azure portal or PowerShell.

准备阶段Before you begin

备注

本文已经过更新,以便使用 Azure Az PowerShell 模块。This article has been updated to use the Azure Az PowerShell module. 若要与 Azure 交互,建议使用的 PowerShell 模块是 Az PowerShell 模块。The Az PowerShell module is the recommended PowerShell module for interacting with Azure. 若要开始使用 Az PowerShell 模块,请参阅安装 Azure PowerShellTo get started with the Az PowerShell module, see Install Azure PowerShell. 若要了解如何迁移到 Az PowerShell 模块,请参阅 将 Azure PowerShell 从 AzureRM 迁移到 AzTo learn how to migrate to the Az PowerShell module, see Migrate Azure PowerShell from AzureRM to Az.

验证 DTU 容量。Verify your DTU capacity. 每个专用 SQL 池(以前称为 SQL DW)都由一个具有默认 DTU 配额的逻辑 SQL Server(例如 myserver.database.chinacloudapi.cn)托管。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. 验证该服务器的剩余 DTU 配额是否足够进行数据库还原。Verify that the server has enough remaining DTU quota for the database being restored.

通过 PowerShell 还原已删除的数据仓库Restore a deleted data warehouse through PowerShell

若要还原已删除的专用 SQL 池(以前称为 SQL DW),请使用 Restore-AzSqlDatabase cmdlet。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.

  1. 开始之前,请确保安装 Azure PowerShellBefore you begin, make sure to install Azure PowerShell.
  2. 打开 PowerShell。Open PowerShell.
  3. 连接到 Azure 帐户,并列出与帐户关联的所有订阅。Connect to your Azure account and list all the subscriptions associated with your account.
  4. 选择包含要还原的已删除专用 SQL 池(以前称为 SQL DW)的订阅。Select the subscription that contains the deleted dedicated SQL pool (formerly SQL DW) to be restored.
  5. 获取特定的已删除数据仓库。Get the specific deleted data warehouse.
  6. 还原已删除的专用 SQL 池(以前称为 SQL DW)Restore the deleted dedicated SQL pool (formerly SQL DW)
    • 若要将已删除的专用 SQL 池(以前称为 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.
  7. 验证已还原的数据仓库是否处于联机状态。Verify that the restored data warehouse is online.
  8. 完成还原后,可以按在恢复后配置数据库中的说明配置恢复后的数据仓库。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

通过 Azure 门户还原已删除的数据库Restore a deleted database using the Azure portal

  1. 登录到 Azure 门户Sign in to the Azure portal.

  2. 导航到承载着已删除数据仓库的服务器。Navigate to the server your deleted data warehouse was hosted on.

  3. 在目录中选择“已删除的数据库”图标。Select the Deleted databases icon in the table of contents.

    已删除的数据库

  4. 选择要还原的已删除 Azure Synapse Analytics。Select the deleted Azure Synapse Analytics that you want to restore.

    选择“已删除的数据库”

  5. 指定新的 数据库名称,并单击“确定”Specify a new Database name and click OK

    指定数据库名称

后续步骤Next Steps