Databases - Export

匯出資料庫。

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export?api-version=2021-11-01

URI 參數

名稱 位於 必要 類型 Description
databaseName
path True

string

資料庫的名稱。

resourceGroupName
path True

string

包含資源的資源群組名稱。 您可以從 Azure 資源管理員 API 或入口網站取得這個值。

serverName
path True

string

伺服器的名稱。

subscriptionId
path True

string

可識別 Azure 訂用帳戶的訂用帳戶識別碼。

api-version
query True

string

要用於要求的 API 版本。

要求本文

名稱 必要 類型 Description
administratorLogin True

string

系統管理員登入名稱。

administratorLoginPassword True

string

系統管理員登入密碼。

storageKey True

string

記憶體金鑰。

storageKeyType True

StorageKeyType

儲存器金鑰類型。

storageUri True

string

記憶體 URI。

authenticationType

string

驗證類型。

networkIsolation

NetworkIsolationSettings

選擇性資源資訊,可啟用要求的網路隔離。

回應

名稱 類型 Description
200 OK

ImportExportOperationResult

已成功匯出資料庫。

202 Accepted

正在匯出資料庫。

Other Status Codes

錯誤回應: ≦

  • 400 MissingImportExportInputParameters - 遺漏 ImportExport 輸入參數。

  • 400 InvalidImportExportInputParameter - 匯入/導出要求失敗,因為輸入參數無效。

  • 400 PolybaseImportAuthenticationTypeNotSupported - PolybaseImport 作業不支持驗證類型參數。

  • 400 DatabaseExtensionsInvalidOperationMode - 資料庫延伸模組的 operationMode 參數無效。

  • 400 DatabaseExtensionsInvalidStorageKeyType - 記憶體密鑰類型必須由 'StorageAccessKey' 使用。

  • 400 DatabaseExtensionsMissingStorageUri - 記憶體 URI 不可空白。

  • 400 InvalidSku - 使用者指定了無效的 SKU。

  • 400 InvalidTierSkuCombination - 指定的層不支援指定的 SKU。

  • 400 DatabaseInvalidSkuPropertyCombination - 要求 SKU 的屬性不一致。 請檢查是否已指定有效的組合。 如需更多詳細資料,請參閱 https://docs.microsoft.com/en-us/rest/api/sql/capabilities/listbylocation#serviceobjectivecapability \(英文\)。

  • 400 InvalidMaxSizeTierCombination - 指定的層不支援指定的資料庫大小上限。

  • 400 FeatureDisabledOnSelectedEdition - 用戶嘗試使用目前資料庫版本停用的功能。

  • 400 InvalidImportExportParameter - 匯入/匯出要求因輸入參數無效而失敗。

  • 400 InvalidTier - 使用者指定了無效的階層。

  • 400 InvalidOperationType - 提供有效的作業類型。

  • 400 ImportExportJobError - ImportExport 作業失敗。

  • 400 BlockedByOutboundFirewall - 輸出防火牆規則封鎖了要求。

  • 404 ResourceNotFound - 指定不存在資源的要求無效。

  • 404 ServerNotInSubscriptionResourceGroup - 指定的伺服器不存在於指定的資源群組和訂用帳戶中。

  • 404 ImportExportOperationIdNotFound - 找不到匯入或導出的作業標識符。

  • 404 ServerNotInSubscription - 指定的伺服器不存在於指定的訂用帳戶上。

  • 404 OperationIdNotFound - 標識符為 的作業不存在。

  • 409 ImportExportOperationInProgress - 資料庫中正在進行匯入或導出作業。

  • 409 OperationCancelled - 使用者已取消作業。

  • 409 OperationInterrupted - 無法完成資源上的作業,因為它被相同資源上的另一個作業中斷。

  • 429 SubscriptionTooManyCreateUpdateRequests - 超出可用資源可處理之最大要求的要求。

  • 429 SubscriptionTooManyRequests - 超出可用資源可處理之最大要求的要求。

  • 500 OperationTimedOut - 作業逾時並自動回復。 請重試該作業。

  • 503 TooManyRequests - 超出可用資源可處理之最大要求的要求。

範例

Exports a database, using private link to communicate with SQL server and storage account.
Exports a database.

Sample Request

POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/export?api-version=2021-11-01

{
  "storageKeyType": "StorageAccessKey",
  "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==",
  "storageUri": "https://test.blob.core.windows.net/test.bacpac",
  "administratorLogin": "login",
  "administratorLoginPassword": "password",
  "authenticationType": "Sql",
  "networkIsolation": {
    "sqlServerResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr",
    "storageAccountResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"
  }
}

Sample Response

{
  "properties": {
    "requestId": "9d9a794a-5cec-4f23-af70-d29511b522a4",
    "requestType": "Export",
    "queuedTime": "2/2/2020 8:33:27 PM",
    "lastModifiedTime": "2/2/2020 8:34:47 PM",
    "blobUri": "https://test.blob.core.windows.net/test.bacpac",
    "serverName": "testsvr.database.windows.net",
    "databaseName": "testdb",
    "status": "Completed"
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4",
  "name": "9d9a794a-5cec-4f23-af70-d29511b522a4",
  "type": "Microsoft.Sql/servers/databases/importExportOperationResults"
}

Exports a database.

Sample Request

POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/export?api-version=2021-11-01

{
  "storageKeyType": "StorageAccessKey",
  "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==",
  "storageUri": "https://test.blob.core.windows.net/test.bacpac",
  "administratorLogin": "login",
  "administratorLoginPassword": "password",
  "authenticationType": "Sql"
}

Sample Response

{
  "properties": {
    "requestId": "9d9a794a-5cec-4f23-af70-d29511b522a4",
    "requestType": "Export",
    "queuedTime": "2/2/2020 8:33:27 PM",
    "lastModifiedTime": "2/2/2020 8:34:47 PM",
    "blobUri": "https://test.blob.core.windows.net/test.bacpac",
    "serverName": "testsvr.database.windows.net",
    "databaseName": "testdb",
    "status": "Completed"
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4",
  "name": "9d9a794a-5cec-4f23-af70-d29511b522a4",
  "type": "Microsoft.Sql/servers/databases/importExportOperationResults"
}

定義

名稱 Description
ExportDatabaseDefinition

包含執行匯出資料庫作業所需的資訊。

ImportExportOperationResult

ImportExport 作業結果資源。

NetworkIsolationSettings

包含要為其建立私人端點連線的 ARM 資源。

PrivateEndpointConnectionRequestStatus

包含私人端點連線要求狀態。

StorageKeyType

儲存器金鑰類型。

ExportDatabaseDefinition

包含執行匯出資料庫作業所需的資訊。

名稱 類型 Description
administratorLogin

string

系統管理員登入名稱。

administratorLoginPassword

string

系統管理員登入密碼。

authenticationType

string

驗證類型。

networkIsolation

NetworkIsolationSettings

選擇性資源資訊,可啟用要求的網路隔離。

storageKey

string

記憶體金鑰。

storageKeyType

StorageKeyType

儲存器金鑰類型。

storageUri

string

記憶體 URI。

ImportExportOperationResult

ImportExport 作業結果資源。

名稱 類型 Description
id

string

資源識別碼。

name

string

資源名稱。

properties.blobUri

string

Blob URI。

properties.databaseName

string

資料庫名稱。

properties.errorMessage

string

錯誤訊息。

properties.lastModifiedTime

string

上次修改時間。

properties.privateEndpointConnections

PrivateEndpointConnectionRequestStatus[]

取得與此要求相關聯的私人端點狀態。

properties.queuedTime

string

已排入佇列的時間。

properties.requestId

string

要求標識碼。

properties.requestType

string

要求類型。

properties.serverName

string

伺服器名稱。

properties.status

string

作業狀態。

type

string

資源類型。

NetworkIsolationSettings

包含要為其建立私人端點連線的 ARM 資源。

名稱 類型 Description
sqlServerResourceId

string

SQL Server 的資源標識碼,這是此要求的目標。 如果設定,將會為 SQL Server 建立私人端點連線。 必須符合作業目標的伺服器。

storageAccountResourceId

string

用來儲存 BACPAC 檔案之記憶體帳戶的資源識別碼。 如果設定,將會為記憶體帳戶建立私人端點連線。 必須符合用於 StorageUri 參數的記憶體帳戶。

PrivateEndpointConnectionRequestStatus

包含私人端點連線要求狀態。

名稱 類型 Description
privateEndpointConnectionName

string

私人端點的連接名稱。

privateLinkServiceId

string

建立私人端點的資源標識碼。

status

string

此私人端點連線的狀態。

StorageKeyType

儲存器金鑰類型。

名稱 類型 Description
SharedAccessKey

string

StorageAccessKey

string