Share via


삭제된 작업 영역에서 전용 SQL 풀 복원

이 문서에서는 PowerShell을 사용하여 작업 영역을 실수로 삭제한 후 Azure Synapse Analytics에서 전용 SQL 풀을 복원하는 방법을 알아봅니다.

참고 항목

이 지침은 Azure Synapse 작업 영역의 전용 SQL 풀에만 적용됩니다. 독립 실행형 전용 SQL 풀(이전의 SQL DW)의 경우 삭제된 서버에서 SQL 풀 복원 지침을 따르세요.

시작하기 전에

참고 항목

Azure Az PowerShell 모듈을 사용하여 Azure와 상호 작용하는 것이 좋습니다. 시작하려면 Azure PowerShell 설치를 참조하세요. Az PowerShell 모듈로 마이그레이션하는 방법에 대한 자세한 내용은 Azure PowerShell을 AzureRM에서 Azure로 마이그레이션을 참조하세요.

삭제된 작업 영역에서 SQL 풀 복원

  1. PowerShell 열기

  2. Azure 계정에 연결합니다.

  3. 삭제된 작업 영역이 포함된 구독으로 컨텍스트를 설정합니다.

  4. 작업 영역을 삭제한 대략적 날짜/시간을 지정합니다.

  5. 삭제된 작업 영역에서 복구하려는 데이터베이스의 리소스 ID를 생성합니다.

  6. 삭제된 작업 영역에서 데이터베이스 복원

  7. 복구된 데이터베이스의 상태를 ‘온라인’으로 확인합니다.

    $SubscriptionID="<YourSubscriptionID>"
    $ResourceGroupName="<YourResourceGroupName>"
    $WorkspaceName="<YourWorkspaceNameWithoutURLSuffixSeeNote>"  # Without sql.azuresynapse.net
    $DatabaseName="<YourDatabaseName>"
    $TargetResourceGroupName="<YourTargetResourceGroupName>" 
    $TargetWorkspaceName="<YourtargetServerNameWithoutURLSuffixSeeNote>"  
    $TargetDatabaseName="<YourDatabaseName>"
    
    Connect-AzAccount
    Set-AzContext -SubscriptionID $SubscriptionID
    
    # Define the approximate point in time the workspace was dropped as DroppedDateTime "yyyy-MM-ddThh:mm:ssZ" (ex. 2022-01-01T16:15:00Z)
    $PointInTime="<DroppedDateTime>" 
    $DroppedDateTime = Get-Date -Date $PointInTime 
    
    
    # construct the resource ID of the sql pool you wish to recover. The format required Microsoft.Sql. This includes the approximate date time the server was dropped.
    $SourceDatabaseID = "/subscriptions/"+$SubscriptionID+"/resourceGroups/"+$ResourceGroupName+"/providers/Microsoft.Sql/servers/"+$WorkspaceName+"/databases/"+$DatabaseName
    
    # Restore to the target workspace with the source SQL pool.
    $RestoredDatabase = Restore-AzSynapseSqlPool -FromDroppedSqlPool -DeletionDate $DroppedDateTime -TargetSqlPoolName $TargetDatabaseName -ResourceGroupName $TargetResourceGroupName -WorkspaceName $TargetWorkspaceName -ResourceId $SourceDatabaseID
    
    # Verify the status of restored database
    $RestoredDatabase.status
    

문제 해결

“요청을 처리하는 동안 예기치 않은 오류가 발생했습니다.” 메시지가 수신되면 원래 작업 영역의 수명이 짧아서 원래 데이터베이스에 사용 가능한 복구 지점이 없는 것일 수 있습니다. 일반적으로 작업 영역이 1시간 미만인 경우입니다.