Share via


삭제된 서버에서 전용 SQL 풀(이전의 SQL DW) 복원

이 문서에서는 PowerShell을 사용하여 서버를 실수로 삭제한 후 Azure Synapse Analytics에서 전용 SQL 풀(이전의 SQL DW)을 복원하는 방법을 알아봅니다.

참고 항목

이 지침은 독립 실행형 전용 SQL 풀(이전의 SQL DW)에만 해당됩니다. Azure Synapse Analytics 작업 영역의 전용 SQL 풀은 삭제된 작업 영역에서 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>"
$ServerName="<YourServerNameWithoutURLSuffixSeeNote>"  # Without database.windows.net
$DatabaseName="<YourDatabaseName>"
$TargetServerName="<YourtargetServerNameWithoutURLSuffixSeeNote>"  
$TargetDatabaseName="<YourDatabaseName>"

Connect-AzAccount
Set-AzContext -SubscriptionId $SubscriptionID

# Define the approximate point in time the server 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 database 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/"+$ServerName+"/restorableDroppedDatabases/"+$DatabaseName+","+$DroppedDateTime.ToUniversalTime().ToFileTimeUtc().ToString()

# Restore to target workspace with the source database.
$RestoredDatabase = Restore-AzSqlDatabase -FromDeletedDatabaseBackup -DeletionDate $DroppedDateTime -ResourceGroupName $ResourceGroupName -ServerName $TargetServerName -TargetDatabaseName $TargetDatabaseName -ResourceId $SourceDatabaseID 

# Verify the status of restored database
$RestoredDatabase.status

문제 해결

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