你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Restore-AzSynapseSqlPool
还原 Synapse Analytics SQL 池。
语法
Restore-AzSynapseSqlPool
[-FromBackup]
[-ResourceGroupName <String>]
-WorkspaceName <String>
-Name <String>
-ResourceId <String>
[-Tag <Hashtable>]
[-StorageAccountType <String>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Restore-AzSynapseSqlPool
[-FromBackup]
-WorkspaceObject <PSSynapseWorkspace>
-Name <String>
-ResourceId <String>
[-Tag <Hashtable>]
[-StorageAccountType <String>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Restore-AzSynapseSqlPool
[-FromRestorePoint]
[-ResourceGroupName <String>]
-WorkspaceName <String>
-Name <String>
-PerformanceLevel <String>
-ResourceId <String>
-RestorePoint <DateTime>
[-Tag <Hashtable>]
[-StorageAccountType <String>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Restore-AzSynapseSqlPool
[-FromRestorePoint]
-WorkspaceObject <PSSynapseWorkspace>
-Name <String>
-PerformanceLevel <String>
-ResourceId <String>
-RestorePoint <DateTime>
[-Tag <Hashtable>]
[-StorageAccountType <String>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Restore-AzSynapseSqlPool
[-FromDroppedSqlPool]
[-ResourceGroupName <String>]
-WorkspaceName <String>
-Name <String>
-ResourceId <String>
-DeletionDate <DateTime>
[-Tag <Hashtable>]
[-StorageAccountType <String>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Restore-AzSynapseSqlPool
[-FromDroppedSqlPool]
-WorkspaceObject <PSSynapseWorkspace>
-Name <String>
-ResourceId <String>
-DeletionDate <DateTime>
[-Tag <Hashtable>]
[-StorageAccountType <String>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Restore-AzSynapseSqlPool cmdlet 从异地冗余备份、已删除 SQL 池的备份或任何 SQL 池的还原点还原 Azure Synapse Analytics SQL 池。 还原的 SQL 池将创建为新的 SQL 池。
示例
示例 1
# Transform Synapse SQL pool resource ID to SQL database ID because
# currently the command only accepts the SQL databse ID. For example: /subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroupName>/providers/Microsoft.Sql/servers/<WorkspaceName>/databases/<DatabaseName>
$pool = Get-AzSynapseSqlPool -ResourceGroupName ContosoResourceGroup -WorkspaceName ContosoWorkspace -Name ContosoSqlPool
$databaseId = $pool.Id -replace "Microsoft.Synapse", "Microsoft.Sql" `
-replace "workspaces", "servers" `
-replace "sqlPools", "databases"
# Get the latest restore point
$restorePoint = $pool | Get-AzSynapseSqlPoolRestorePoint | Select-Object -Last 1
# Restore to same workspace with source SQL pool
$restoredPool = Restore-AzSynapseSqlPool -FromRestorePoint -RestorePoint $restorePoint.RestorePointCreationDate -TargetSqlPoolName ContosoRestoredSqlPool -ResourceGroupName $pool.ResourceGroupName -WorkspaceName $pool.WorkspaceName -ResourceId $databaseId -PerformanceLevel DW200c
此命令利用任何现有 SQL 池中的还原点从以前的状态恢复或复制,创建 Azure Synapse Analytics SQL 池。
示例 2
# Transform Synapse SQL pool resource ID to SQL database ID because
# currently the command only accepts the SQL databse ID. For example: /subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroupName>/providers/Microsoft.Sql/servers/<WorkspaceName>/recoverabledatabases/<DatabaseName>
$pool = Get-AzSynapseSqlPoolGeoBackup -ResourceGroupName ContosoResourceGroup -WorkspaceName ContosoWorkspace -Name ContosoSqlPool
$databaseId = $pool.Id -replace "Microsoft.Synapse", "Microsoft.Sql" `
-replace "workspaces", "servers"
# Restore to same workspace with source SQL pool
$restoredPool = Restore-AzSynapseSqlPool -FromBackup -TargetSqlPoolName ContosoRestoredSqlPool -ResourceGroupName $pool.ResourceGroupName -WorkspaceName $pool.WorkspaceName -ResourceId $databaseId
此命令创建一个从 SQL 池备份还原的 Azure Synapse Analytics SQL 池。
示例 3
# Transform Synapse dropped SQL pool resource ID to SQL pool resource ID
$pool = Get-AzSynapseDroppedSqlPool -ResourceGroupName ContosoResourceGroup -WorkspaceName ContosoWorkspace -Name ContosoSqlPool
$poolId = $pool.Id.Split(",")[0]
$poolId = $poolId -replace "restorableDroppedSqlPools", "sqlPools"
# Restore to same workspace with source SQL pool
$restoredPool = Restore-AzSynapseSqlPool -FromDroppedSqlPool -DeletionDate $pool.DeletionDate -TargetSqlPoolName ContosoRestoredSqlPool -ResourceGroupName $pool.ResourceGroupName -WorkspaceName $pool.WorkspaceName -ResourceId $poolId
此命令创建一个从已删除的 SQL 池备份还原的 Azure Synapse Analytics SQL 池。
示例 4
# Transform Synapse SQL pool resource ID to SQL database ID because
# currently the command only accepts the SQL databse ID. For example: /subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroupName>/providers/Microsoft.Sql/servers/<WorkspaceName>/databases/<DatabaseName>
$pool = Get-AzSynapseSqlPool -ResourceGroupName ContosoResourceGroup -WorkspaceName ContosoWorkspace -Name ContosoSqlPool
$databaseId = $pool.Id -replace "Microsoft.Synapse", "Microsoft.Sql" `
-replace "workspaces", "servers" `
-replace "sqlPools", "databases"
# Get the latest restore point
$restorePoint = $pool | Get-AzSynapseSqlPoolRestorePoint | Select-Object -Last 1
# Restore to same workspace with source SQL pool
$restoredPool = Restore-AzSynapseSqlPool -FromRestorePoint -RestorePoint $restorePoint.RestorePointCreationDate -TargetSqlPoolName ContosoRestoredSqlPool -ResourceGroupName $pool.ResourceGroupName -WorkspaceName $pool.WorkspaceName -ResourceId $databaseId -PerformanceLevel DW200c -Tag @{"tagName" = "tagValue"} -StorageAccountType LRS
此命令利用任何现有 SQL 池中的还原点从任何现有 SQL 池恢复或从以前的状态复制,创建具有指定标记和存储帐户类型的 Azure Synapse Analytics SQL 池。
参数
-AsJob
在后台运行 cmdlet
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DeletionDate
要检索备份的 Azure Synaspe SQL 数据库的删除日期(例如,2016-02-23T00:21:22.847Z)
类型: | DateTime |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-FromBackup
指示从此订阅中任何 SQL 池的最新备份还原。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-FromDroppedSqlPool
指示利用此订阅中任何 SQL 池的还原点从以前的状态恢复或复制。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-FromRestorePoint
指示利用此订阅中任何 SQL 池的还原点从以前的状态恢复或复制。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Name
Synapse SQL 池的名称。
类型: | String |
别名: | TargetSqlPoolName |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-PerformanceLevel
要分配给 SQL 池的 SQL 服务层级和性能级别。 例如,DW2000c。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
资源组名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceId
要还原的数据库的资源 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-RestorePoint
还原的快照时间。
类型: | DateTime |
别名: | PointInTime |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-StorageAccountType
用于存储 sql 池备份的存储帐户类型。 可能的值包括:“GRS”、“LRS”。
类型: | String |
接受的值: | GRS, LRS |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Tag
与资源关联的标记的字符串字符串字典。
类型: | Hashtable |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WorkspaceName
Synapse 工作区的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-WorkspaceObject
工作区输入对象,通常通过管道传递。
类型: | PSSynapseWorkspace |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |