이 글은 RcEST API를 사용하여 Azure Backup이 생성한 복원 지점에서 Azure VM의 SQL 서버 데이터베이스를 복원하는 방법을 설명합니다.
이 문서를 끝까지 읽으면 REST API를 사용하여 다음 작업을 수행하는 방법을 배우게 될 것입니다.
- 백업된 SQL 데이터베이스의 복원 지점을 봅니다.
- SQL 데이터베이스 및 인스턴스에 대한 스냅샷 복구 지점과 시점 복구 범위를 쿼리합니다.
- 복구 지점에 포함된 데이터베이스와 데이터 디렉터리 경로를 검색하세요.
- 전체 SQL 데이터베이스를 복원합니다.
현재 지원되는 백업 및 복원 시나리오를 보려면 지원 매트릭스를 참조하세요. 일반적인 질문은 자주 묻는 질문을 참조하세요.
필수 조건
복원을 위해 백업된 SQL 데이터베이스가 있다고 가정합니다. 데이터베이스가 없는 경우 REST API를 사용하여 Azure VM의 SQL Server 데이터베이스 백업을 참조하여 만듭니다.
이 문서에서는 다음 리소스를 사용합니다.
- Recovery Services 자격 증명 모음: SQLServer2012
- 리소스 그룹: SQLServerSelfHost
- SQL 서버: sqlserver-0
- SQL 데이터베이스: msdb
기본 지역 복원
주 지역에서 일반 복원 작업을 트리거하려면 다음 섹션을 참조하세요. 지역 간 복원의 경우 지역 간 복원 섹션을 참조하세요.
"ContainerName" 및 "ProtectedItemName" 가져오기
대부분의 복원 관련 API 호출의 경우 {containerName} 및 {protectedItemName} URI 매개 변수의 값을 전달해야 합니다.
GET backupprotectableitems 작업의 응답 본문에서 ID 특성을 사용하여 이러한 매개 변수의 값을 검색합니다. 이 예제에서 보호하려는 데이터베이스의 ID는 다음과 같습니다.
/subscriptions/00000000-0000-0000-0000-0000000000/resourceGroups/SQLServerSelfHost/providers/microsoft.recoveryservices/vaults/SQLServer2012/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;SQLServerPMDemo;sqlserver-0/protectedItems/sqldatabase;mssqlserver;msdb
값은 다음과 같이 변환됩니다.
-
{containername}: VMAppContainer;Compute;SQLServerPMDemo;sqlserver-0 -
{protectedItemName}: sqldatabase; mssqlserver; msdb
백업된 SQL 데이터베이스에 대한 복구 지점 가져오기
백업된 데이터베이스를 복원하려면 다음을 수행합니다.
복원 작업을 수행할 복구 지점을 선택합니다.
복구 지점 목록 REST API 호출을 사용하여 백업된 항목의 사용 가능한 복구 지점을 나열합니다. 모든 관련 값이 있는 GET 작업입니다.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints?api-version=2016-12-01다음과 같이 URI 값을 설정합니다.
-
{fabricName}: Azure -
{vaultName}: SQLServer2012 -
{containerName}: VMAppContainer;Compute;SQLServerPMDemo;sqlserver-0 -
{protectedItemName}: sqldatabase; mssqlserver; msdb -
{resourceGroupName}: SQLServerSelfHost
GET URI에는 필요한 모든 매개 변수가 있습니다. 추가 요청 본문이 필요없습니다.
GET "https://management.azure.com/subscriptions/00000000-0000-0000-0000-0000000000/resourceGroups/SQLServerSelfHost/providers/microsoft.RecoveryServices/vaults/SQLServer2012/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;SQLServerPMDemo;sqlserver-0/protectedItems/sqldatabase;mssqlserver;msdb/recoveryPoints?api-version=2016-12-01"-
복구 지점 가져오기 예시 응답
GET URI를 제출하면 200 응답이 반환됩니다.
HTTP/1.1 200 OK
Pragma: no-cache
X-Content-Type-Options: nosniff
x-ms-request-id: fab6cc6f-db1e-4ac1-acac-fc82ebdb1fdb
x-ms-client-request-id: 6fb93717-2876-47df-b01f-d53af5f08785; 6fb93717-2876-47df-b01f-d53af5f08785
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-reads: 14999
x-ms-correlation-request-id: fab6cc6f-db1e-4ac1-acac-fc82ebdb1fdb
x-ms-routing-request-id: SOUTHINDIA:20180604T061127Z:fab6cc6f-db1e-4ac1-acac-fc82ebdb1fdb
Cache-Control: no-cache
Date: Mon, 04 Jun 2018 06:11:26 GMT
Server: Microsoft-IIS/8.0
X-Powered-By: ASP.NET
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-0000000000/resourceGroups/SQLServerSelfHost/providers/microsoft.recoveryservices/vaults/SQLServer2012/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;SQLServerPMDemo;sqlserver-0/protectedItems/SQLDataBase;mssqlserver;msdb/recoveryPoints/55515936059579",
"name": "55515936059579",
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
"properties": {
"objectType": "AzureWorkloadSQLRecoveryPoint",
"recoveryPointTimeInUTC": "2018-06-01T22:15:12Z",
"type": "Full"
}
},
{
"id": "/subscriptions/00000000-0000-0000-0000-0000000000/resourceGroups/SQLServerSelfHost/providers/microsoft.recoveryservices/vaults/SQLServer2012/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;SQLServerPMDemo;sqlserver-0/protectedItems/SQLDataBase;mssqlserver;msdb/recoveryPoints/62043109781074",
"name": "62043109781074",
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
"properties": {
"objectType": "AzureWorkloadSQLRecoveryPoint",
"recoveryPointTimeInUTC": "2018-05-31T22:15:08Z",
"type": "Full"
}
},
{
"id": "/subscriptions/00000000-0000-0000-0000-0000000000/resourceGroups/SQLServerSelfHost/providers/microsoft.recoveryservices/vaults/SQLServer2012/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;SQLServerPMDemo;sqlserver-0/protectedItems/SQLDataBase;mssqlserver;msdb/recoveryPoints/69710749096214",
"name": "69710749096214",
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
"properties": {
"objectType": "AzureWorkloadSQLRecoveryPoint",
"recoveryPointTimeInUTC": "2018-05-30T22:15:09Z",
"type": "Full"
}
},
{
"id": "/subscriptions/00000000-0000-0000-0000-0000000000/resourceGroups/SQLServerSelfHost/providers/microsoft.recoveryservices/vaults/SQLServer2012/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;SQLServerPMDemo;sqlserver-0/protectedItems/SQLDataBase;mssqlserver;msdb/recoveryPoints/55459165802209",
"name": "55459165802209",
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
"properties": {
"objectType": "AzureWorkloadSQLRecoveryPoint",
"recoveryPointTimeInUTC": "2018-05-29T22:15:15Z",
"type": "Full"
}
},
{
"id": "/subscriptions/00000000-0000-0000-0000-0000000000/resourceGroups/SQLServerSelfHost/providers/microsoft.recoveryservices/vaults/SQLServer2012/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;SQLServerPMDemo;sqlserver-0/protectedItems/SQLDataBase;mssqlserver;msdb/recoveryPoints/56798287946753",
"name": "56798287946753",
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
"properties": {
"objectType": "AzureWorkloadSQLRecoveryPoint",
"recoveryPointTimeInUTC": "2018-05-28T13:18:15Z",
"type": "Full"
}
},
{
"id": "/subscriptions/00000000-0000-0000-0000-0000000000/resourceGroups/SQLServerSelfHost/providers/microsoft.recoveryservices/vaults/SQLServer2012/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;SQLServerPMDemo;sqlserver-0/protectedItems/SQLDataBase;mssqlserver;msdb/recoveryPoints/DefaultRangeRecoveryPoint",
"name": "DefaultRangeRecoveryPoint",
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
"properties": {
"objectType": "AzureWorkloadSQLPointInTimeRecoveryPoint",
"timeRanges": [
{
"startTime": "2018-05-28T11:03:34Z",
"endTime": "2018-06-02T00:02:31Z"
}
],
"type": "Log"
}
}
]
}
위 응답의 {name} 필드로 복구 지점을 식별합니다.
쿼리 스냅샷 및 스트리밍 복구 지점
스냅샷으로 보호된 SQL 인스턴스와 데이터베이스의 경우, 다음 복구 포인트 쿼리에 대해 2024-01-31-preview API 버전을 사용하세요. URI 자리 표시자를 금고 정보와 보호 품목 나열에서 반환된 컨테이너 및 보호 품목 이름으로 교체하면 됩니다. 요청을 보낼 때 필터 표현식을 URL 인코딩하세요.
restorePointQueryType를 사용하여 복구 지점 유형을 선택:
| 가치 | 회복 지점이 반환됨 |
|---|---|
FullDifferentialAndSnapshot |
데이터베이스의 전체, 차등 및 스냅샷 복구 지점. |
Snapshot |
데이터베이스나 인스턴스의 스냅샷 복구 지점. |
FullAndDifferential |
데이터베이스용 전체 및 차동 복구 지점 스트리밍. |
Log |
데이터베이스의 로그 복구 시간 범위를 기록합니다. |
전체 복구 지점, 차등 복구 지점, 스냅샷 복구 지점 목록
데이터베이스 보호 항목 이름을 사용하세요. 예를 들어 SQLDataBase;mssqlserver;testdb:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/Azure/protectionContainers/{containerName}/protectedItems/{databaseProtectedItemName}/recoveryPoints?api-version=2024-01-31-preview&$filter=restorePointQueryType eq 'FullDifferentialAndSnapshot'
스냅샷 복구 지점 목록
데이터베이스의 경우, 데이터베이스 보호 항목 이름을 사용하세요:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/Azure/protectionContainers/{containerName}/protectedItems/{databaseProtectedItemName}/recoveryPoints?api-version=2024-01-31-preview&$filter=restorePointQueryType eq 'Snapshot'
인스턴스의 경우, 다음과 같은 SQLInstance;mssqlserver인스턴스 보호 항목 이름을 사용하세요:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/Azure/protectionContainers/{containerName}/protectedItems/{instanceProtectedItemName}/recoveryPoints?api-version=2024-01-31-preview&$filter=restorePointQueryType eq 'Snapshot'
스트리밍 전체 및 차등 복구 지점 나열
또한 시간 창을 지정하고 소프트 삭제 복구 지점을 포함할 수도 있습니다:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/Azure/protectionContainers/{containerName}/protectedItems/{databaseProtectedItemName}/recoveryPoints?api-version=2024-01-31-preview&$filter=startDate eq '2024-02-15 05:12:12 PM' and endDate eq '2024-02-22 05:12:12 PM' and restorePointQueryType eq 'FullAndDifferential' and includeSoftDeletedRP eq 'true'
샘플 날짜를 필요한 기간으로 교체하세요.
value 배열은 type, recoveryPointTierDetails, recoveryPointTimeInUTC와 같은 속성을 가진 복구 지점을 포함합니다. 보존 정보는 ruleName에 나타날 수 있으며, 여기에는 isSoftDeleted, expiryTime 및 recoveryPointProperties가 포함됩니다.
시점 복원을 위한 쿼리 로그 복구 범위
데이터베이스의 로그 복구 범위를 나열하려면 다음 요청을 사용하세요:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/Azure/protectionContainers/{containerName}/protectedItems/{databaseProtectedItemName}/recoveryPoints?api-version=2024-01-31-preview&$filter=restorePointQueryType eq 'Log'
답변에는 DefaultRangeRecoveryPoint 항목이 포함되어 있습니다. 다음 예시는 선택된 응답 필드를 보여줍니다:
{
"value": [
{
"name": "DefaultRangeRecoveryPoint",
"properties": {
"objectType": "AzureWorkloadSQLPointInTimeRecoveryPoint",
"timeRanges": [
{
"startTime": "2024-02-07T17:12:13.2853054Z",
"endTime": "2024-02-22T15:30:13Z"
}
],
"type": "Log"
}
}
]
}
반환된 범위 내에서 복원 시간을 선택하세요.
복구 모드별 데이터베이스 로그 범위 쿼리
스트리밍 기반 복구의 경우, 다음을 명시하세요 recoveryMode eq 'WorkloadRecovery':
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/Azure/protectionContainers/{containerName}/protectedItems/{databaseProtectedItemName}/recoveryPoints?api-version=2024-01-31-preview&$filter=restorePointQueryType eq 'Log' and recoveryMode eq 'WorkloadRecovery'
스냅샷 기반 복구의 경우, 다음을 지정하세요: recoveryMode eq 'SnapshotAttachAndRecover'
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/Azure/protectionContainers/{containerName}/protectedItems/{databaseProtectedItemName}/recoveryPoints?api-version=2024-01-31-preview&$filter=restorePointQueryType eq 'Log' and recoveryMode eq 'SnapshotAttachAndRecover'
두 쿼리 모두 앞서 보인 로그 복구 범위 응답 형식을 반환합니다.
인스턴스 복원을 위해 데이터베이스 로그 범위를 조회합니다
인스턴스 시점 복원의 경우, 먼저 인스턴스 스냅샷 복구 지점을 선택하고 포함된 데이터베이스를 검색합니다. 포함된 각 데이터베이스에 대해 선택한 기본 스냅샷 세부 정보를 사용하여 로그 범위를 조회하세요:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/Azure/protectionContainers/{containerName}/protectedItems/{databaseProtectedItemName}/recoveryPoints?api-version=2024-01-31-preview&$filter=restorePointQueryType eq 'Log' and recoveryMode eq 'SnapshotAttachAndRecover' and baseSnapshotRPId eq '{baseSnapshotRPId}' and baseRPDatasourceId eq '{baseRPDatasourceId}'
-
{baseSnapshotRPId}: 선택한 인스턴스 스냅샷 복구 지점의name. -
{baseRPDatasourceId}: 하위 데이터베이스의 데이터 소스 ID가 아니라 보호된 항목의 인스턴스의protectedItemDataSourceId입니다. -
{databaseProtectedItemName}: 조회 중인 자식 데이터베이스의 보호 항목 이름입니다.
인스턴스 스냅샷에서 데이터베이스와 디스크 경로를 얻으세요
선택한 인스턴스 복구 지점을 가져와 포함된 데이터베이스와 디스크 경로를 검색합니다. 인스턴스 스냅샷 복원 또는 인스턴스 시점 복원을 준비할 때 동일한 메타데이터를 사용하세요:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/Azure/protectionContainers/{containerName}/protectedItems/{instanceProtectedItemName}/recoveryPoints/{snapshotRecoveryPointId}?api-version=2024-01-31-preview
{snapshotRecoveryPointId} 는 회복점의 name입니다. 다음 예시는 선택된 응답 필드를 보여줍니다:
{
"name": "2265756871711897922",
"properties": {
"objectType": "AzureWorkloadSQLRecoveryPoint",
"extendedInfo": {
"dataDirectoryTimeInUTC": "2024-03-13T08:03:25Z",
"dataDirectoryPaths": [
{
"type": "DiskDrives",
"path": "F:\\"
},
{
"type": "DiskDrives",
"path": "G:\\"
}
],
"includedDatabases": [
{
"datasourceId": "2265838378698362078",
"datasourceName": "MSSQLSERVER;user1"
}
],
"snapshotRecoveryPointInfo": {}
},
"recoveryPointTimeInUTC": "2024-03-13T08:03:25Z",
"type": "SnapshotFull",
"recoveryPointTierDetails": [
{
"type": "InstantRP",
"status": "Valid"
}
]
}
}
extendedInfo.includedDatabases 선택한 스냅샷에서 캡처된 데이터베이스를 식별합니다.
extendedInfo.dataDirectoryPaths 고급 복원 설정에 사용할 수 있는 디스크 경로를 식별합니다.
고급 복원 구성을 위한 데이터베이스 경로 가져오기
데이터베이스 스트리밍 또는 스냅샷 복구 지점의 경우, 복구 지점 세부 정보를 가져와야 합니다:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/Azure/protectionContainers/{containerName}/protectedItems/{databaseProtectedItemName}/recoveryPoints/{recoveryPointId}?api-version=2023-02-01
properties.extendedInfo.dataDirectoryPaths의 데이터 및 로그 파일 경로와 논리 이름을 점검하세요. 다음은 그 예입니다.
{
"dataDirectoryTimeInUTC": "2024-03-04T18:03:35Z",
"dataDirectoryPaths": [
{
"type": "Data",
"path": "F:\\DATA\\TestDB1.mdf",
"logicalName": "TestDB1"
},
{
"type": "Log",
"path": "F:\\LOG\\TestDB1_log.ldf",
"logicalName": "TestDB1_log"
}
],
"snapshotRecoveryPointInfo": {}
}
데이터베이스 시점 복원의 경우, 로그 복구 범위를 나열할 때 확장 정보를 요청하세요. 다음 예시는 스냅샷 기반 복구를 사용합니다:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/Azure/protectionContainers/{containerName}/protectedItems/{databaseProtectedItemName}/recoveryPoints?api-version=2023-02-01&$filter=startDate eq '2024-02-06 07:50:56 AM' and endDate eq '2024-03-07 07:23:05 AM' and extendedInfo eq 'true' and restorePointQueryType eq 'Log' and recoveryMode eq 'SnapshotAttachAndRecover'
샘플 날짜를 필요한 쿼리 기간으로 교체하세요. 응답은 로그 복구 범위와 properties.extendedInfo를 포함하며, 여기에는 dataDirectoryTimeInUTC, dataDirectoryPaths, 그리고 snapshotRecoveryPointInfo가 있습니다.
앞서 언급한 쿼리들은 복구 지점과 복원 구성 메타데이터를 검색합니다. 다음 섹션에서는 기존 스트리밍 데이터베이스 복원 요청을 설명합니다.
REST API를 통한 데이터베이스 복구
복원을 트리거하는 것은 POST 요청입니다. 이 작업을 수행하려면 트리거 복원 REST API를 사용합니다.
POST https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore?api-version=2019-05-13
값 {containerName}과 {protectedItemName}은 여기에 설정된 것과 같고, recoveryPointID는 위에서 언급한 복구 지점의 {name} 필드입니다.
POST https://management.azure.com/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SQLServerSelfHost/providers/Microsoft.RecoveryServices/vaults/SQLServer2012/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;SQLServerPMDemo;sqlserver-0/protectedItems/sqldatabase;mssqlserver;msdb/recoveryPoints/56798287946753/restore?api-version=2019-05-13'
요청 본문 만들기
동일한 데이터 디렉터리에 데이터베이스를 복원하기 위한 요청 본문 예제
다음 요청 본문은 동일한 데이터 디렉터리로 SQL 데이터베이스 복원을 트리거하는 데 필요한 속성을 정의합니다.
{
"properties":{
"objectType":"AzureWorkloadSQLRestoreRequest",
"shouldUseAlternateTargetLocation":false,
"isNonRecoverable":false,
"targetInfo":{"ContainerName": "compute;SQLServerPMDemo;sqlserver-0", "DatabaseName" : "SQLINSTANCE/msdb"},
"alternateDirectoryPaths":null,
"isFallbackOnDefaultDirectoryEnabled":true,
"recoveryType":"AlternateLocation",
"sourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SQLServerPMDemo/providers/Azure/virtualmachines/compute;SQLServerPMDemo;sqlserver-0"
}
}
대체 데이터 디렉터리에 데이터베이스를 복원하기 위한 요청 본문 예제
다음 요청 본문은 동일한 데이터 디렉터리로 SQL 데이터베이스 복원을 트리거하는 데 필요한 속성을 정의합니다.
{
"properties":{
"objectType":"AzureWorkloadSQLRestoreRequest",
"shouldUseAlternateTargetLocation":true,
"isNonRecoverable":false,
"targetInfo":
{
"overwriteOption":"Overwrite","containerName":"compute;oneboxrg;oneboxvm","databaseName":"SQLINSTANCE/msdb"},
"alternateDirectoryPaths":[{"mappingType":"Log","sourcePath":"C:\\SQLfiles\\Default.ldf","targetPath":"C:\\SQLFiles\\Temp.ldf"}],
"recoveryType":"AlternateLocation",
"sourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SQLServerPMDemo/providers/Azure/virtualmachines/compute;SQLServerPMDemo;sqlserver-0"
}
}
}
응답
복원 작업의 트리거는 비동기 작업입니다. 이 작업을 수행하면 별도로 추적해야 하는 다른 작업이 생성됩니다.
이 작업은 다른 작업을 만드는 경우 202(수락됨), 해당 작업이 완료되는 경우 200(정상)의 두 응답을 반환합니다.
응답 예제
Status Code:
OK
Headers:
Pragma : no-cache
Cache-Control : no-cache
Server : Microsoft-IIS/10.0,Microsoft-IIS/10.0
X-Content-Type-Options : nosniff
x-ms-request-id : f17973f5-c788-482f-8aad-6bb50e647a2e
x-ms-client-request-id : b0356a0e-c68d-4ac2-a53f-4f546685146d,b0356a0e-c68d-4ac2-a53f-4f546685146d
X-Powered-By : ASP.NET
Strict-Transport-Security : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-resource-requests: 149
x-ms-correlation-request-id : f17973f5-c788-482f-8aad-6bb50e647a2e
x-ms-routing-request-id : SOUTHINDIA:20210801T104711Z:f17973f5-c788-482f-8aad-6bb50e647a2e
Date : Sun, 01 Aug 2021 10:47:11 GMT
{
"id":"/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SQLServerSelfHost/providers/Microsoft.RecoveryServices/vaults/SQLServer2012/backupJobs/0bda1a53-73fa-427e-9a1c-72a2016adee3",
"name": "0bda1a53-73fa-427e-9a1c-72a2016adee3",
"type": "Microsoft.RecoveryServices/vaults/backupJobs",
"properties": {
"jobType": "AzureWorkloadJob",
"actionsInfo": [
1
],
"workloadType": "SQLDataBase",
"duration": "PT1.6543659S",
"extendedInfo": {
"tasksList": [
{
"taskId": "Transfer data from vault",
"status": "InProgress"
}
],
"propertyBag": {
"Job Type": "Recovery to the original database"
}
},
"isUserTriggered": true,
"entityFriendlyName": "msdb [sqlserver-0]",
"backupManagementType": "AzureWorkload",
"operation": "Restore",
"status": "InProgress",
"startTime": "2021-08-01T10:47:09.5865449Z",
"activityId": "b0356a0e-c68d-4ac2-a53f-4f546685146d"
}
}
지역 간 복원
지역 간 복원을 사용하도록 설정한 경우 복구 지점도 쌍을 이루는 보조 지역으로 복제됩니다. 그런 다음, 해당 복구 지점을 가져와서 쌍을 이루는 해당 지역에 있는 머신에 대한 복원을 트리거할 수 있습니다. 일반 복원을 사용하면 대상 머신은 보조 지역의 대상 자격 증명 모음에 등록되어야 합니다. 다음 단계에서는 엔드투엔드 프로세스를 설명합니다.
보조 지역에 복제된 백업 항목을 가져옵니다.
아래 예제에서는 다음이 필요합니다.
- 컨테이너: VMAppContainer;Compute;SQLServerPMDemo;sqlserver-0
- 이 문서의 앞부분에 설명된 단계를 사용하여 복원해야 하는 데이터베이스에 대한 보호된 항목(sqldatabase;mssqlserver;msdb).
보조 지역에 복제되는 복구 지점(고유 및/또는 로그)을 가져옵니다.
쌍을 이루는 보조 지역 내의 자격 증명 모음에 등록된 대상 서버를 선택합니다.
해당 서버에 대한 복원을 트리거하고 JobId를 사용하여 추적합니다.
참고
보조 지역에서 사용할 수 있는 백업 데이터의 RPO는 12시간입니다. 따라서 CRR을 켜면 보조 지역의 RPO는 12시간 + 로그 빈도 기간(최소 15분으로 설정할 수 있음)입니다.
보조 지역에서 고유한 복구 지점 가져오기
복구 지점 목록 API를 사용하여 보조 지역의 데이터베이스에 대해 사용 가능한 복구 지점 목록을 가져옵니다. 다음 예제에서는 지정된 시간 범위 내에서 전체 및 차동 복구 지점을 가져오기 위해 선택적 필터가 적용됩니다.
GET "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SQLServerSelfHost/providers/Microsoft.RecoveryServices/vaults/SQLServer2012/backupFabrics/Azure/protectionContainers/VMAppContainer;compute;SQLServerPMDemo;sqlserver-0/protectedItems/SQLDataBase;mssqlserver;msdb/recoveryPoints/?$filter=startDate eq'2021-07-25 08:41:32 AM' and endDate eq '2021-08-01 08:41:45 AM' and restorePointQueryType eq 'FullAndDifferential' and extendedInfo eq 'True'&api-version=2018-12-20"
복구 지점 가져오기 응답 예시
Headers:
Pragma : no-cache
X-Content-Type-Options : nosniff
x-ms-request-id : 66b3fbb4-e38a-4a4b-98c7-56db66ab52e6
x-ms-client-request-id : 35eb7834-8b5c-4a2c-adda-eee2ed02eb08,35eb7834-8b5c-4a2c-adda-eee2ed02eb08
Strict-Transport-Security : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-resource-requests: 149
x-ms-correlation-request-id : 66b3fbb4-e38a-4a4b-98c7-56db66ab52e6
x-ms-routing-request-id : SOUTHINDIA:20210801T102906Z:66b3fbb4-e38a-4a4b-98c7-56db66ab52e6
Cache-Control : no-cache
Date : Sun, 01 Aug 2021 10:29:06 GMT
Server : Microsoft-IIS/10.0
X-Powered-By : ASP.NET
Body:
{
"value": [
{
"id":
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SQLServerSelfHost/providers/Microsoft.RecoveryServices/vaults/SQLServer2012/backupFabrics/Azure/protectionContainers/VMAppContainer;compute;SQLServerPMDemo;sqlserver-0/protectedItems/SQLDataBase;mssqlserver;msdb/RecoveryPoints/932604119111216382",
"name": "932604119111216382",
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
"properties": {
"objectType": "AzureWorkloadSQLRecoveryPoint",
"recoveryPointTimeInUTC": "2021-07-31T16:33:48Z",
"type": "Full"
}
},
{
"id":
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SQLServerSelfHost/providers/Microsoft.RecoveryServices/vaults/SQLServer2012/backupFabrics/Azure/protectionContainers/VMAppContainer;compute;SQLServerPMDemo;sqlserver-0/protectedItems/SQLDataBase;mssqlserver;msdb/RecoveryPoints/932599942005436803",
"name": "932599942005436803",
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
"properties": {
"objectType": "AzureWorkloadSQLRecoveryPoint",
"recoveryPointTimeInUTC": "2021-07-30T16:33:49Z",
"type": "Full"
}
},
.....
위 응답의 {name} 필드로 복구 지점을 식별합니다.
액세스 토큰 가져오기
지역 간 복원을 수행하려면 Azure Backup 서비스 간의 적절한 통신을 가능하게 하는 액세스 토큰이 있어야 합니다. 액세스 토큰을 가져오려면 다음 단계를 수행합니다.
Microsoft Entra 속성 API를 사용하여 보조 지역(아래 예제에서는 westus)에 대한 Microsoft Entra 속성을 가져옵니다.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/westus/backupAadProperties?api-version=2018-12-20반환된 응답은 아래 형식입니다.
{ "properties": { "tenantId": "00000000-0000-0000-0000-000000000000", "audience": "https://RecoveryServices/IaasCoord/aadmgmt/wus", "servicePrincipalObjectId": "00000000-0000-0000-0000-000000000000" } }액세스 토큰 API 가져오기를 사용하여 Azure Backup 서비스 간의 통신을 활성화하는 액세스 토큰을 가져옵니다.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken?api-version=2018-12-20요청 본문의 경우 이전 단계의 Microsoft Entra 속성 API에서 반환된 응답의 내용을 붙여넣습니다.
반환된 응답 형식은 다음과 같습니다.
{ "protectableObjectUniqueName": "MSSQLSERVER/model", "protectableObjectFriendlyName": "msdb", "protectableObjectWorkloadType": "SQL", "protectableObjectProtectionState": "Protected", "protectableObjectContainerHostOsName": "sqlserver-0", "protectableObjectParentLogicalContainerName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SQLServerPMDemo/providers/Microsoft.Compute/virtualMachines/sqlserver-0", "containerId": "0000000", "policyName": "HourlyLogBackup", "policyId": "00000000-0000-0000-0000-000000000000", "objectType": "WorkloadCrrAccessToken", "accessTokenString": "<access-token-string>", "subscriptionId": "00000000-0000-0000-0000-000000000000", "resourceGroupName": "SQLServerSelfHost", "resourceName": "SQLServer2012", "resourceId": "0000000000000000000", "protectionContainerId": 0000000, "recoveryPointId": "932603497994988273", "recoveryPointTime": "7/31/2021 4:33:17 PM", "containerName": "Compute;SQLServerPMDemo;sqlserver-0", "containerType": "VMAppContainer", "backupManagementType": "AzureWorkload", "datasourceType": "SQLDataBase", "datasourceName": "msdb", "datasourceId": "932350676859704517", "datasourceContainerName": "Compute;SQLServerPMDemo;sqlserver-0", "coordinatorServiceStampId": "00000000-0000-0000-0000-000000000000", "coordinatorServiceStampUri": "https://pod01-wbcm1.eus.backup.windowsazure.com", "protectionServiceStampId": "00000000-0000-0000-0000-000000000000", "protectionServiceStampUri": "https://pod01-prot1j-int.eus.backup.windowsazure.com", "rpOriginalSAOption": false, "rpIsManagedVirtualMachine": false, "bMSActiveRegion": "EastUS" }
디스크를 보조 지역으로 복원
지역 간 복원 트리거 API를 사용하여 항목을 보조 지역으로 복원합니다.
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore?api-version=2018-12-20
요청 본문에는 다음 두 부분이 있어야 합니다.
crossRegionRestoreAccessDetails: 이전 단계에서 수행한 액세스 토큰 얻기 API 요청에서 응답의 properties 블록을 붙여넣어 요청 본문의 이 세그먼트를 채웁니다.
restoreRequest: 요청 본문의 restoreRequest 세그먼트를 채우려면 데이터베이스를 복원해야 하는 컨테이너(보조 지역의 볼트에 등록)의 세부 정보와, 복원된 데이터베이스가 저장될 이름을 함께 전달해야 합니다. 보조 지역에 대한 전체 백업 복원을 수행하려면 AlternateLocation을 복구 유형으로 지정합니다.
VM의 디스크를 보조 지역으로 복원하는 샘플 요청 본문은 다음과 같습니다.
{
"crossRegionRestoreAccessDetails": {
"protectableObjectUniqueName": "MSSQLSERVER/model",
"protectableObjectFriendlyName": "msdb",
"protectableObjectWorkloadType": "SQL",
"protectableObjectProtectionState": "Protected",
"protectableObjectContainerHostOsName": "sqlserver-0",
"protectableObjectParentLogicalContainerName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SQLServerPMDemo/providers/Microsoft.Compute/virtualMachines/sqlserver-0",
"containerId": "0000000",
"policyName": "HourlyLogBackup",
"policyId": "00000000-0000-0000-0000-000000000000",
"objectType": "WorkloadCrrAccessToken",
"accessTokenString": "<access-token-string>",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "SQLServerSelfHost",
"resourceName": "SQLServer2012",
"resourceId": "0000000000000000000",
"protectionContainerId": 0000000,
"recoveryPointId": "932603497994988273",
"recoveryPointTime": "7/31/2021 4:33:17 PM",
"containerName": "Compute;SQLServerPMDemo;sqlserver-0",
"containerType": "VMAppContainer",
"backupManagementType": "AzureWorkload",
"datasourceType": "SQLDataBase",
"datasourceName": "msdb",
"datasourceId": "932350676859704517",
"datasourceContainerName": "Compute;SQLServerPMDemo;sqlserver-0",
"coordinatorServiceStampId": "00000000-0000-0000-0000-000000000000",
"coordinatorServiceStampUri": "https://pod01-wbcm1.eus.backup.windowsazure.com",
"protectionServiceStampId": "00000000-0000-0000-0000-000000000000",
"protectionServiceStampUri": "https://pod01-prot1j-int.eus.backup.windowsazure.com",
"rpOriginalSAOption": false,
"rpIsManagedVirtualMachine": false,
"bMSActiveRegion": "EastUS"
},
"restoreRequest": {
"objectType": "AzureWorkloadSQLRestoreRequest",
"shouldUseAlternateTargetLocation": true,
"isNonRecoverable": false,
"alternateDirectoryPaths": [],
"recoveryType": "AlternateLocation",
"sourceResourceId":"/subscriptions/600000000-0000-0000-0000-000000000000/resourceGroups/SQLServerPMDemo/providers/Microsoft.Compute/virtualMachines/sqlserver-0",
"targetInfo": {
"overwriteOption": "FailOnConflict",
"containerId":"/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RestoreRG/providers/Microsoft.RecoveryServices/vaults/wusRestoreVault/backupFabrics/Azure/protectionContainers/vmappcontainer;compute;restorerg;wusrestorevm",
"databaseName": "MSSQLSERVER/msdb_restored_8_1_2021_1758"
}
}
}
스냅샷 정책으로 보호되는 SQL 인스턴스에 대해 시점 복구 리전 간 복원을 수행합니다
이 흐름을 사용해 SQL 인스턴스 스냅샷에 포함된 데이터베이스를 복원하고, 로그 백업을 재생하여 보조 영역에서 공통 시점으로 복구합니다.
Important
선택한 시점은 인스턴스 스냅샷에서 복구하려는 모든 데이터베이스의 로그 범위에 포함되어야 합니다. SQL 인스턴스 보호 항목과 선택한 구체적 스냅샷 복구 지점에 대한 액세스 토큰을 요청합니다.
인스턴스 스냅샷과 로그 범위를 확인하세요
SQL 인스턴스 보호 항목의 복구 지점을 나열하세요.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{sourceVaultResourceGroup}/providers/Microsoft.RecoveryServices/vaults/{sourceVaultName}/backupFabrics/Azure/protectionContainers/{sourceContainerName}/protectedItems/SQLInstance%3Bmssqlserver/recoveryPoints?api-version=2023-01-15응답이 다음 모든 값을 포함하는 복구 지점을 선택합니다:
-
properties.type은SnapshotFull입니다. -
properties.crossRegionRestoreState은Supported입니다. -
properties.recoveryPointTierDetails은 사태가Valid인HardenedRP를 포함합니다.
-
선택한 복구 지점을 가져와 권한 있는 확장 정보를 가져오세요.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{sourceVaultResourceGroup}/providers/Microsoft.RecoveryServices/vaults/{sourceVaultName}/backupFabrics/Azure/protectionContainers/{sourceContainerName}/protectedItems/SQLInstance%3Bmssqlserver/recoveryPoints/{instanceSnapshotRecoveryPointId}?api-version=2023-01-15properties.extendedInfo.includedDatabases를 사용하여 스냅샷에 포함된 자식 데이터베이스를 식별합니다. 응답에는 복원에 필요한 소스 디스크 경로와 스냅샷 메타데이터도 포함되어 있습니다.SQL 인스턴스 보호 항목을 가져와
properties.protectedItemDataSourceId에 저장하세요.GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{sourceVaultResourceGroup}/providers/Microsoft.RecoveryServices/vaults/{sourceVaultName}/backupFabrics/Azure/protectionContainers/{sourceContainerName}/protectedItems/SQLInstance%3Bmssqlserver?api-version=2023-01-15포함된 각 데이터베이스에 대해 선택한 인스턴스 스냅샷과 연관된 로그 범위를 나열하세요.
GET "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{sourceVaultResourceGroup}/providers/Microsoft.RecoveryServices/vaults/{sourceVaultName}/backupFabrics/Azure/protectionContainers/{sourceContainerName}/protectedItems/SQLDataBase%3Bmssqlserver%3B{databaseName}/recoveryPoints?api-version=2023-01-15&$filter=restorePointQueryType eq 'Log' and recoveryMode eq 'SnapshotAttachAndRecover' and baseSnapshotRPId eq '{instanceSnapshotRecoveryPointId}' and baseRPDatasourceId eq '{instanceProtectedItemDataSourceId}'"응답에
DefaultRangeRecoveryPoint가 포함됩니다. 복원 중인 각 데이터베이스마다 반환된properties.timeRanges내에 해당하는 UTCpointInTime를 선택하세요.
인스턴스 스냅샷의 액세스 토큰을 받으세요
보조 영역에 대한 Microsoft Entra 속성을 가져오세요.
GET "https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{secondaryRegion}/backupAadProperties?api-version=2023-01-15&$filter=backupManagementType eq 'AzureWorkload'"
SQL 인스턴스 및 선택한 스냅샷 복구 지점에 대한 액세스 토큰을 요청할 때 반환된 properties 객체를 요청 본문에 전달하세요.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{sourceVaultResourceGroup}/providers/Microsoft.RecoveryServices/vaults/{sourceVaultName}/backupFabrics/Azure/protectionContainers/{sourceContainerName}/protectedItems/SQLInstance%3Bmssqlserver/recoveryPoints/{instanceSnapshotRecoveryPointId}/accessToken?api-version=2023-01-15
{
"properties": {
"tenantId": "<tenant-id>",
"audience": "<audience-returned-by-the-service>",
"servicePrincipalObjectId": "<service-principal-object-id>",
"identityVersion": 1
}
}
SQL 인스턴스의 시점 복원 트리거
AzureWorkloadSQLPointInTimeRestoreRequest와 함께 SnapshotAttachAndRecover을 사용합니다. 접근 토큰 응답에서 전체 crossRegionRestoreAccessDetails 객체를 properties에 복사합니다.
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{secondaryRegion}/backupCrossRegionRestore?api-version=2023-01-15
{
"crossRegionRestoreAccessDetails": {
"objectType": "WorkloadCrrAccessToken",
"accessTokenString": "<access-token-string>",
"recoveryPointId": "<instance-snapshot-recovery-point-id>",
"datasourceType": "SQLInstance",
"datasourceName": "mssqlserver"
},
"restoreRequest": {
"objectType": "AzureWorkloadSQLPointInTimeRestoreRequest",
"shouldUseAlternateTargetLocation": true,
"recoveryMode": "SnapshotAttachAndRecover",
"isNonRecoverable": false,
"recoveryType": "AlternateLocation",
"sourceResourceId": "/subscriptions/{subscriptionId}/resourceGroups/{sourceVmResourceGroup}/providers/Microsoft.Compute/virtualMachines/{sourceVmName}",
"targetVirtualMachineId": "/subscriptions/{subscriptionId}/resourceGroups/{targetVmResourceGroup}/providers/Microsoft.Compute/virtualMachines/{targetVmName}",
"targetResourceGroupName": "{targetVmResourceGroup}",
"pointInTime": "2026-08-09T17:18:23.500Z",
"alternateDirectoryPaths": [
{
"mappingType": "DiskDrives",
"sourcePath": "F:\\",
"targetPath": "J:\\"
},
{
"mappingType": "DiskDrives",
"sourcePath": "G:\\",
"targetPath": "K:\\"
}
],
"targetInfo": {
"containerId": "/subscriptions/{subscriptionId}/resourceGroups/{targetVaultResourceGroup}/providers/Microsoft.RecoveryServices/vaults/{targetVaultName}/backupFabrics/Azure/protectionContainers/{targetContainerName}",
"overwriteOption": "FailOnConflict",
"databaseName": "MSSQLSERVER/*_{databaseNameSuffix}"
},
"userAssignedManagedIdentityDetails": {
"identityArmId": "/subscriptions/{subscriptionId}/resourceGroups/{identityResourceGroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}",
"userAssignedIdentityProperties": {
"clientId": "<managed-identity-client-id>",
"principalId": "<managed-identity-principal-id>"
}
}
}
}
위의 축약된 crossRegionRestoreAccessDetails 객체는 인스턴스 시나리오를 식별하는 필드를 보여줍니다. 실제 요청에서는 액세스 토큰 API가 반환하는 모든 속성을 tokenExtendedInformation가 있을 경우 이를 포함하여 복사하세요.
스냅샷 정책으로 보호되는 자식 데이터베이스에 대해 교차 지역 로그 복원을 수행합니다
이 흐름을 사용하여 SQL 인스턴스 스냅샷 정책의 일부로 보호되는 자식 데이터베이스 하나를 선택한 특정 시점으로 복원할 수 있습니다.
Important
하위 데이터베이스 로그 복원을 위해, 하위 SQLDataBase 보호 항목과 DefaultRangeRecoveryPoint에 대해 접근 토큰을 요청하세요. 상위 SQL 인스턴스 복구 지점에서 토큰을 요청하지 마세요.
자식 데이터베이스 로그 범위 찾기
자식 데이터베이스 보호 항목에 대한 로그 복구 지점을 나열하세요.
GET "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{sourceVaultResourceGroup}/providers/Microsoft.RecoveryServices/vaults/{sourceVaultName}/backupFabrics/Azure/protectionContainers/{sourceContainerName}/protectedItems/SQLDataBase%3Bmssqlserver%3B{databaseName}/recoveryPoints?api-version=2023-01-15&$filter=restorePointQueryType eq 'Log'"
응답에는 하나 이상의 UTC 범위가 있는 DefaultRangeRecoveryPoint가 포함되어 있습니다:
{
"value": [
{
"name": "DefaultRangeRecoveryPoint",
"properties": {
"objectType": "AzureWorkloadSQLPointInTimeRecoveryPoint",
"timeRanges": [
{
"startTime": "2026-07-26T19:25:29.9811766Z",
"endTime": "2026-08-10T18:31:23Z"
}
],
"type": "Log"
}
}
]
}
반환된 범위 내에서 UTC pointInTime 를 선택하세요.
자식 데이터베이스 로그 범위의 액세스 토큰을 가져오세요
SQL 인스턴스 섹션에 표시된 Azure 워크로드 필터를 사용해 보조 지역의 Microsoft Entra 속성을 가져오세요. 자식 데이터베이스 접근 토큰을 요청할 때 반환된 properties 객체를 전달합니다.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{sourceVaultResourceGroup}/providers/Microsoft.RecoveryServices/vaults/{sourceVaultName}/backupFabrics/Azure/protectionContainers/{sourceContainerName}/protectedItems/SQLDataBase%3Bmssqlserver%3B{databaseName}/recoveryPoints/DefaultRangeRecoveryPoint/accessToken?api-version=2023-01-15
반환된 액세스 토큰 속성은 다음과 같은 값으로 선택된 자식 데이터베이스를 식별합니다:
{
"properties": {
"protectableObjectUniqueName": "MSSQLSERVER/{databaseName}",
"protectableObjectFriendlyName": "{databaseName}",
"objectType": "WorkloadCrrAccessToken",
"accessTokenString": "<access-token-string>",
"recoveryPointId": "DefaultRangeRecoveryPoint",
"datasourceType": "SQLDataBase",
"datasourceName": "{databaseName}"
}
}
자식 데이터베이스 로그 복원을 트리거합니다
AzureWorkloadSQLPointInTimeRestoreRequest와 함께 SnapshotAttachAndRecover을 사용합니다. 대상 데이터베이스 이름은 MSSQLSERVER/{targetDatabaseName}논리 경로 형식을 사용해야 합니다.
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{secondaryRegion}/backupCrossRegionRestore?api-version=2023-01-15
{
"crossRegionRestoreAccessDetails": {
"objectType": "WorkloadCrrAccessToken",
"accessTokenString": "<access-token-string>",
"recoveryPointId": "DefaultRangeRecoveryPoint",
"datasourceType": "SQLDataBase",
"datasourceName": "{databaseName}"
},
"restoreRequest": {
"objectType": "AzureWorkloadSQLPointInTimeRestoreRequest",
"shouldUseAlternateTargetLocation": true,
"recoveryMode": "SnapshotAttachAndRecover",
"isNonRecoverable": false,
"recoveryType": "AlternateLocation",
"sourceResourceId": "/subscriptions/{subscriptionId}/resourceGroups/{sourceVmResourceGroup}/providers/Microsoft.Compute/virtualMachines/{sourceVmName}",
"targetVirtualMachineId": "/subscriptions/{subscriptionId}/resourceGroups/{targetVmResourceGroup}/providers/Microsoft.Compute/virtualMachines/{targetVmName}",
"targetResourceGroupName": "{targetVmResourceGroup}",
"pointInTime": "2026-08-03T06:58:26Z",
"alternateDirectoryPaths": [
{
"mappingType": "DiskDrives",
"sourcePath": "F:\\",
"targetPath": "J:\\"
},
{
"mappingType": "DiskDrives",
"sourcePath": "G:\\",
"targetPath": "K:\\"
}
],
"targetInfo": {
"containerId": "/subscriptions/{subscriptionId}/resourceGroups/{targetVaultResourceGroup}/providers/Microsoft.RecoveryServices/vaults/{targetVaultName}/backupFabrics/Azure/protectionContainers/{targetContainerName}",
"overwriteOption": "FailOnConflict",
"databaseName": "MSSQLSERVER/{targetDatabaseName}"
},
"userAssignedManagedIdentityDetails": {
"identityArmId": "/subscriptions/{subscriptionId}/resourceGroups/{identityResourceGroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}",
"userAssignedIdentityProperties": {
"clientId": "<managed-identity-client-id>",
"principalId": "<managed-identity-principal-id>"
}
}
}
}
인스턴스 요청과 마찬가지로, 완전한 액세스 토큰 properties 객체를 crossRegionRestoreAccessDetails에 복사합니다.
tokenExtendedInformation와 accessTokenString를 비밀로 간주하고 로그에 기록하거나 공유 산출물에 포함시키지 마세요.
두 시점 상황 모두 트리거는 비동기식입니다.
Azure-AsyncOperation, Location 및 Retry-After 응답 헤더를 따르고, 복원을 성공으로 처리하기 전에 결과로 생성된 복구 서비스 금고 작업의 최종 상태를 확인하세요.
다음 단계
Azure Portal, Azure CLI, REST API를 사용하여 Azure VM에서 SQL Server 데이터베이스를 관리합니다.
Azure Backup REST API에 대한 자세한 내용은 다음 문서를 참조하세요.