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>]
Description
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 集區的還原點,從任何現有的 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
此命令會建立 Azure Synapse Analytics SQL 集區,以從已刪除的 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 集區的還原點來復原或複製先前狀態,以建立具有指定標籤和記憶體帳戶類型的 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
要還原之資料庫的資源標識碼。
類型: | 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 |