Managed Databases - Create Or Update

建立新的資料庫或更新現有資料庫。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}?api-version=2021-11-01

URI 參數

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

string

資料庫的名稱。

managedInstanceName
path True

string

受管理的執行個體名稱。

resourceGroupName
path True

string

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

subscriptionId
path True

string

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

api-version
query True

string

要用於要求的 API 版本。

要求本文

名稱 必要 類型 Description
location True

string

資源位置。

properties.autoCompleteRestore

boolean

是否要自動完成此受控資料庫的還原。

properties.catalogCollation

CatalogCollationType

元資料目錄的定序。

properties.collation

string

Managed 資料庫的定序。

properties.createMode

ManagedDatabaseCreateMode

受控資料庫建立模式。 PointInTimeRestore:藉由還原現有資料庫的時間點備份來建立資料庫。 必須指定SourceDatabaseName、SourceManagedInstanceName和PointInTime。 RestoreExternalBackup:從外部備份文件還原來建立資料庫。 必須指定 Collation、StorageContainerUri 和 StorageContainerSasToken。 復原:藉由還原異地復寫備份來建立資料庫。 RecoverableDatabaseId 必須指定為可復原的資料庫資源標識符,才能還原。 RestoreLongTermRetentionBackup:從長期保留備份還原 (longTermRetentionBackupResourceId 所需的) 來建立資料庫。

properties.lastBackupName

string

還原此受控資料庫的最後一個備份檔名。

properties.longTermRetentionBackupResourceId

string

要用於還原此受控資料庫之長期保留備份的名稱。

properties.recoverableDatabaseId

string

與這個資料庫建立作業相關聯的可復原資料庫資源標識符。

properties.restorableDroppedDatabaseId

string

建立此資料庫時要還原的可還原已卸除資料庫資源標識符。

properties.restorePointInTime

string

條件。 如果 createMode 是 PointInTimeRestore,則需要此值。 指定將還原以建立新資料庫之源資料庫) (ISO8601 時間點。

properties.sourceDatabaseId

string

與此資料庫建立作業相關聯的源資料庫資源標識符。

properties.storageContainerSasToken

string

條件。 如果 createMode 為 RestoreExternalBackup,則需要此值。 指定記憶體容器 sas 令牌。

properties.storageContainerUri

string

條件。 如果 createMode 為 RestoreExternalBackup,則需要此值。 指定儲存此還原備份之記憶體容器的 URI。

tags

object

資源標籤。

回應

名稱 類型 Description
200 OK

ManagedDatabase

已成功更新資料庫。

201 Created

ManagedDatabase

已成功建立資料庫。

202 Accepted

已接受

Other Status Codes

錯誤回應: ≦

  • 400 PitrPointInTimeInvalid - 時間 {0} 點無效。 來源伺服器建立時間之前,早 {1} 到現在的有效時間點範圍從天到現在為止。

  • 400 CannotUseTrailingWhitespacesInDatabaseName - 資料庫名稱驗證失敗。

  • 400 StorageAccountFull - 受控執行個體 已達到基礎 Azure 記憶體帳戶的總容量。 Azure 進階儲存體帳戶限制為 35TB 的配置空間。

  • 400 AkvHostNotResolvingFromNode - 伺服器 '' 上的{1} AKV 主機 '{0}' 無法從 SQL 解析。

  • 400 InvalidBackupRetentionPeriod - 的 {0} 保留天數不是有效的設定。 有效的備份保留天數必須介於和 之間{1}{2}

  • 400 ManagedDatabaseNameInUse - 資料庫 '{0}' 已經存在。 請選擇其他資料庫名稱。

  • 400 NoMoreSpaceInManagedInstance - 受控實例已達到其記憶體限制。 受控實例的記憶體使用量不能超過 (%d) MB。

  • 400 ManagedInstanceUpdateSloInProgress - 「作業無法完成,因為受控實例 』{0}.' 的服務層級變更正在進行中。 請等候正在進行的作業完成,並再試一次。」

  • 400 SameKeyMaterialNotFoundOnRemoteServer - 輔助伺服器沒有主伺服器加密保護裝置的密鑰數據。

  • 400 SourceDatabaseNotFound - 源資料庫不存在。

  • 400 RegionDoesNotSupportVersion - 用戶嘗試在不支援該伺服器版本的位置中建立指定版本的伺服器。

  • 400 PasswordNotComplex - 所提供的密碼不夠複雜。

  • 400 CannotUseReservedDatabaseName - 無法在此作業中使用保留的資料庫名稱。

  • 400 InvalidServerName - 指定的伺服器名稱無效。

  • 400 SourceServerNotFound - CreateDatabaseAsCopy API 呼叫中提供之源資料庫標識符的伺服器部分不會對應至現有的伺服器。

  • 400 TokenTooLong - 提供的令牌太長。

  • 400 CurrentDatabaseSizeExceedsMaxSize - 使用者嘗試將資料庫的大小上限縮減為小於目前使用量的大小。

  • 400 InvalidCollation - 伺服器無法辨識定序。

  • 400 AkvEndpointNotReachableFromNode - 無法從伺服器 '' 上的 SQL 連線到 AKV 端點 '{0}{1}'。

  • 400 ServerNotFound - 找不到所要求的伺服器。

  • 400 UnsupportedServiceName - 指定的名稱是無效的名稱,因為它包含一或多個不支援的 Unicode 字元。

  • 400 CurrentDatabaseLogSizeExceedsMaxSize - 使用者嘗試將資料庫變更為最大記錄大小低於目前使用量的 SKU。

  • 400 DatabaseNumberLimitReached - 達到 SQL Database 受控執行個體 的資料庫數目上限。

  • 400 InvalidDatabaseCreateOrUpdateRequest - 建立或更新資料庫作業的要求本文無效。

  • 400 InvalidResourceId - 無效的資源識別碼。

  • 400 InvalidSourceDatabaseId - 無效的源資料庫標識符。

  • 400 InvalidRestorableDroppedDatabaseId - 可還原的已卸除資料庫標識符無效

  • 400 不符ResourceGroupNameWithUrl - 提供的資源組名與 URL 中的名稱不符。

  • 400 不相符ServerNameWithUrl - 提供的伺服器名稱與 URL 中的名稱不符。

  • 400 不符SubscriptionWithUrl - 提供的訂用帳戶不符合 URL 中的訂用帳戶。

  • 400 MissingCollation - 需要定序。

  • 400 MissingSourceDatabaseId - 遺漏源資料庫標識符。

  • 400 MissingRestorePointInTime - 遺漏還原時間點

  • 400 MissingStorageContainerSasToken - 遺漏記憶體容器 SAS 令牌

  • 400 MissingStorageContainerUri - 遺漏記憶體容器 URI

  • 400 RestoreableDroppedDatabaseIdGivenForRestoreWithSourceDatabaseId - 無法在還原建立模式中指定 sourceDatabaseId 時指定 restoreableDroppedDatabaseId

  • 400 CannotUseReservedDatabaseName - 無法在此作業中使用保留的資料庫名稱。

  • 400 InvalidLongTermRetentionManagedInstanceBackupId - 受控實例的長期保留備份標識符無效。

  • 400 MiGeoRestoreWithWrongBackupStorageRedundancy - Geo-Restore 不允許使用 LRS/ZRS 備份記憶體備援的受控實例。

  • 400 UpdateingInstanceAndBackupRedundancy - 實例區域備援和備份記憶體備援無法在相同的要求中更新。

  • 400 ProvisioningDisabled - 依原樣顯示來自資源作業授權者的錯誤訊息,而不需變更

  • 400 AadOnlyAuthenticationIsEnabled - 已啟用 Azure Active Directory 僅限驗證。 請連絡您的系統管理員。

  • 400 ManagementServiceFeatureDisabled - 用戶嘗試使用已停用的功能。

  • 400 TargetServerDoesNotExist - 目標伺服器 {0} 不存在或尚未就緒。 請檢查它是否存在,然後重試還原要求。

  • 400 TargetServerRestoreNotAllowed - 目標伺服器 {0} 目前不是允許啟動還原的狀態。

  • 400 BackupSetNotFound - 找不到還原資料庫的備份。 請連絡支援人員以還原資料庫。

  • 400 FullBackupNotFound - 找不到完整備份。

  • 400 MissingThumbprint - 找不到伺服器證書。

  • 400 RestoreFromStripedBackupsNotEnabled - 不支援從等量備份還原。

  • 400 BackupSetBroken - 備份集已中斷。

  • 400 BrokenRestorePlanNoFullBackup - 還原計劃已中斷,因為沒有完整備份。

  • 400 SqlRestoreError - 還原具有索引 {0} 的備份時發生無法重試的錯誤 - {1}{2}

  • 400 BrokenRestorePlanWrongLogBackupLSN - 還原計劃已中斷,因為目前記錄備份的第一個Lsn 不是 <= 下一個記錄備份的 lastLsn。

  • 400 BrokenRestorePlanWrongDiffBackupLSN - 還原計劃已中斷,因為差異備份的第一個Lsn 不是 >= 完整備份的 firstLsn。

  • 400 BrokenRestorePlanGapInLogBackups - 還原計劃已中斷,因為目前記錄備份的第一個Lsn 不等於前一個記錄備份的 lastLsn。

  • 400 PartiallyContainedDatabaseUnsupported - 「不支援部分自主資料庫的備份」。

  • 400 RequiredBackupIsNotLastRestored - 移轉無法完成,因為提供的備份檔名不是還原的最後一個備份文件的名稱。

  • 400 XtpInitializedDuringRestore - 記憶體優化檔案群組必須是空的,才能在 SQL Database 受控執行個體 的 常規用途 層上還原。

  • 400 FullBackupMissingChecksum - 提供的完整備份遺漏總和檢查碼。

  • 400 FullBackupDamaged - 提供的完整備份已損毀。

  • 400 MissingStripeInBackupSet - 提供的備份集有一或多個遺漏等量。

  • 400 BrokenRestorePlanWrongDiffBaseGUID - 還原計劃已中斷,因為差異備份的 DifferentialBaseGuid 與完整備份的 BackupSetGuid 不符。

  • 400 IncompatiblePhysicalLayoutTooFewDataFiles - 資料庫備份包含不相容的實體配置。 備份中找不到數據檔。

  • 400 CorruptedPagesInBackupSet - 作業已中止,因為 RESTORE 偵測到備份集中的一或多個損毀頁面。

  • 400 IncompatiblePhysicalLayoutNonOnlineDataFilesExist - 資料庫備份包含不相容的實體配置。 非在線數據檔存在。

  • 400 CorruptedPagesListMaintenance - 作業已中止,因為處理未進行總和檢查碼的備份時發生內部錯誤。

  • 400 IncompatiblePhysicalLayoutWrongNumberOfLogFiles - 資料庫備份包含不相容的實體配置。 不支援多個記錄檔。

  • 400 IncompatiblePhysicalLayoutNonOnlineLogFilesExist - 資料庫備份包含不相容的實體配置。 非在線記錄檔存在。

  • 400 IncompatiblePhysicalLayoutTooManyNonDataLogFiles - 資料庫備份包含不相容的實體配置。 太多非數據/記錄檔。

  • 400 ExternalBackupAlreadySignaledToComplete - 已發出還原要求的訊號以完成。

  • 400 ExternalBackupRestoreHasNotBeenStarted - 還原要求只能在還原啟動時完成。

  • 400 ExternalBackupUpgradeInProgress - 還原要求無法完成,因為升級正在進行中。

  • 400 IncompatiblePhysicalLayoutTooManyXTPFiles - 資料庫備份包含不相容的實體配置。 在包含MEMORY_OPTIMIZED_DATA的檔案群組中找到多個檔案。

  • 400 BlobStorageFailure - 發生 Blob 記憶體失敗。

  • 400 BackupsFromMultipleDatabasesDetectedInTheContainerFromTheStart - 容器資料夾中有多個資料庫的備份。 請確定容器資料夾具有單一資料庫的備份。{0}

  • 400 ManagedIdentityIssueDetectedFromTheStart - 受控識別未正確設定。 請確認並再試一次。

  • 400 ManagedInstanceStorageLimitHit - 受控實例已達到其記憶體限制。

  • 400 AutoCompleteMissingLastBackupName - 自動完成還原要求必須提供 lastBackupName 參數。

  • 400 BlobStorageServerFailure - 發生 Blob 記憶體伺服器失敗。

  • 400 BackupsFromMultipleDatabasesDetectedInTheContainerWhileRestoreInProgress - 容器資料夾中有多個資料庫的備份。 請確定容器資料夾具有單一資料庫的備份。{0}

  • 400 ManagedIdentityIssueDetectedWhileRestoreInProgress - 受控識別未正確設定。 請確認並再試一次。

  • 404 SubscriptionDoesNotHaveServer - 找不到要求的伺服器

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

  • 404 ResourceNotFound - 找不到所要求的資源。

  • 404 CannotFindServerCertificateWithThumbprint - 找不到指紋為 '{0}' 的伺服器證書。 請使用 PowerShell Cmdlet 'Add-AzureRmSqlManagedInstanceTransparentDataEncryptionCertificate' 來建立憑證。

  • 404 CannotFindObject - 找不到對象,因為它不存在或您沒有許可權

  • 404 SubscriptionNotFound - 找不到要求的訂用帳戶。

  • 404 DatabaseDoesNotExist - 使用者已指定不存在於此伺服器實例上的資料庫名稱。

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

  • 404 RestoreSourceDatabaseNotFound - 在可以還原的資料庫 '' 時找不到資料庫 '{0}{1}'。

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

  • 409 RemoteDatabaseExists - 目的地資料庫名稱已存在於目的地伺服器上。

  • 409 ConflictingDatabaseOperation - 資料庫上已經有一些作業,目前的作業應該等到完成為止。

  • 409 SubscriptionDisabled - 已停用訂用帳戶。

  • 409 ManagementServiceDatabaseBusy - 資料庫 '{0}' 正忙於另一項作業。 請稍後試用您的作業。

  • 409 ConflictingSystemOperationInProgress - 資料庫上的系統維護作業正在進行中,而進一步的作業必須等到完成為止。

  • 409 ConflictingManagedInstanceOperation - 受控實例目前正在進行作業。

  • 409 BackupRedundancyUpdateAndInstanceRedundancyConflict - 實例為 multi-az,但備份記憶體會從區域備援更新為非區域備援。

  • 409 InstanceRedundancyUpdateWhileBackupRedundancyUpdateInProgress - 無法更新實例備援,因為備份記憶體備援更新正在進行中。

  • 409 InstanceRedundancyUpdateAndBackupRedundancyConflict - 備份記憶體是非區域備援,但實例備援會更新為區域備援。

  • 409 BackupRedundancyUpdateConflict - 無法更新備份記憶體備援,因為備份記憶體備援更新正在進行中。

  • 409 MiDropFailedOnAuthLocks - 使用者嘗試卸除子網中已套用鎖定 (s) 的最後一個 受控執行個體。

  • 409 MiCreateFailedNonDelegatedSubnet - 使用者嘗試在未委派給 Microsoft.Sql/managedInstances 的子網中部署 受控執行個體 或 受控執行個體 集區。

  • 412 InstanceNotReadyForBackupRedundancyUpdate - 無法更新備份記憶體備援,因為實例尚未就緒。

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

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

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

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

  • 429 ConflictingSubscriptionOperation - 訂閱目前正在進行作業。

  • 500 ActivateOrDeactivateWorkflowThrottling - 啟用或停用工作流程失敗,因為並行工作流程太多

  • 503 DatabaseUnavailable - 作業失敗,因為資料庫無法使用。

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

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

  • 504 RequestTimeout - 服務要求超過允許的逾時。

  • 504 RequestTimeout - 服務要求超過允許的逾時。

範例

Creates a new managed database by restoring from an external backup
Creates a new managed database from restoring a geo-replicated backup
Creates a new managed database from restoring a long term retention backup
Creates a new managed database using point in time restore
Creates a new managed database with maximal properties
Creates a new managed database with minimal properties

Creates a new managed database by restoring from an external backup

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2021-11-01

{
  "properties": {
    "createMode": "RestoreExternalBackup",
    "storageContainerUri": "https://myaccountname.blob.core.windows.net/backups",
    "storageContainerSasToken": "sv=2015-12-11&sr=c&sp=rl&sig=1234",
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "autoCompleteRestore": true,
    "lastBackupName": "last_backup_name"
  },
  "location": "southeastasia"
}

Sample Response

{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1",
  "name": "testdb1",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "status": "Online",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe"
  },
  "type": "Microsoft.Sql/managedInstances/databases"
}
{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb2",
  "name": "testdb2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "status": "Online",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe"
  },
  "type": "Microsoft.Sql/managedInstances/databases"
}

Creates a new managed database from restoring a geo-replicated backup

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/server1/databases/testdb_recovered?api-version=2021-11-01

{
  "location": "southeastasia",
  "properties": {
    "createMode": "Recovery",
    "recoverableDatabaseId": "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/Default-SQL-WestEurope/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDatabases/testdb"
  }
}

Sample Response

{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/server1/recoverableDatabases/testdb_recovered",
  "name": "testdb_recovered",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "status": "Online",
    "creationDate": "2018-11-07T04:41:33.937Z"
  },
  "type": "Microsoft.Sql/managedInstances/databases"
}
{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDatabases/testdb_recovered",
  "name": "testdb_recovered",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "status": "Online",
    "creationDate": "2018-11-07T04:41:33.937Z"
  },
  "type": "Microsoft.Sql/managedInstances/databases"
}

Creates a new managed database from restoring a long term retention backup

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2021-11-01

{
  "properties": {
    "createMode": "RestoreExternalBackup",
    "storageContainerUri": "https://myaccountname.blob.core.windows.net/backups",
    "storageContainerSasToken": "sv=2015-12-11&sr=c&sp=rl&sig=1234",
    "collation": "SQL_Latin1_General_CP1_CI_AS"
  },
  "location": "southeastasia"
}

Sample Response

{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1",
  "name": "testdb1",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "status": "Online",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe"
  },
  "type": "Microsoft.Sql/managedInstances/databases"
}
{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb2",
  "name": "testdb2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "status": "Online",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe"
  },
  "type": "Microsoft.Sql/managedInstances/databases"
}

Creates a new managed database using point in time restore

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2021-11-01

{
  "location": "southeastasia",
  "properties": {
    "createMode": "PointInTimeRestore",
    "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb",
    "restorePointInTime": "2017-07-14T05:35:31.503Z"
  }
}

Sample Response

{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1",
  "name": "testdb1",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "status": "Online",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe"
  },
  "type": "Microsoft.Sql/managedInstances/databases"
}
{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb2",
  "name": "testdb2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "status": "Online",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe"
  },
  "type": "Microsoft.Sql/managedInstances/databases"
}

Creates a new managed database with maximal properties

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2021-11-01

{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "location": "southeastasia"
}

Sample Response

{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1",
  "name": "testdb1",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "status": "Online",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe"
  },
  "type": "Microsoft.Sql/managedInstances/databases"
}
{
  "tags": {
    "tagKey1": "TagValue1"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb2",
  "name": "testdb2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "status": "Online",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe"
  },
  "type": "Microsoft.Sql/managedInstances/databases"
}

Creates a new managed database with minimal properties

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2021-11-01

{
  "location": "southeastasia"
}

Sample Response

{
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1",
  "name": "testdb1",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "status": "Online",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe"
  },
  "type": "Microsoft.Sql/managedInstances/databases"
}
{
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb2",
  "name": "testdb2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "status": "Online",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe"
  },
  "type": "Microsoft.Sql/managedInstances/databases"
}

定義

名稱 Description
CatalogCollationType

元資料目錄的定序。

ManagedDatabase

受控資料庫資源。

ManagedDatabaseCreateMode

受控資料庫建立模式。 PointInTimeRestore:藉由還原現有資料庫的時間點備份來建立資料庫。 必須指定SourceDatabaseName、SourceManagedInstanceName和PointInTime。 RestoreExternalBackup:從外部備份文件還原來建立資料庫。 必須指定 Collation、StorageContainerUri 和 StorageContainerSasToken。 復原:藉由還原異地復寫備份來建立資料庫。 RecoverableDatabaseId 必須指定為可復原的資料庫資源標識符,才能還原。 RestoreLongTermRetentionBackup:從長期保留備份還原 (longTermRetentionBackupResourceId 所需的) 來建立資料庫。

ManagedDatabaseStatus

資料庫的狀態。

CatalogCollationType

元資料目錄的定序。

名稱 類型 Description
DATABASE_DEFAULT

string

SQL_Latin1_General_CP1_CI_AS

string

ManagedDatabase

受控資料庫資源。

名稱 類型 Description
id

string

資源識別碼。

location

string

資源位置。

name

string

資源名稱。

properties.autoCompleteRestore

boolean

是否要自動完成此受控資料庫的還原。

properties.catalogCollation

CatalogCollationType

元資料目錄的定序。

properties.collation

string

Managed 資料庫的定序。

properties.createMode

ManagedDatabaseCreateMode

受控資料庫建立模式。 PointInTimeRestore:藉由還原現有資料庫的時間點備份來建立資料庫。 必須指定SourceDatabaseName、SourceManagedInstanceName和PointInTime。 RestoreExternalBackup:從外部備份文件還原來建立資料庫。 必須指定 Collation、StorageContainerUri 和 StorageContainerSasToken。 復原:藉由還原異地復寫備份來建立資料庫。 RecoverableDatabaseId 必須指定為可復原的資料庫資源標識符,才能還原。 RestoreLongTermRetentionBackup:從長期保留備份還原 (longTermRetentionBackupResourceId 所需的) 來建立資料庫。

properties.creationDate

string

資料庫的建立日期。

properties.defaultSecondaryLocation

string

地理配對區域。

properties.earliestRestorePoint

string

還原時間點的最早還原時間點。

properties.failoverGroupId

string

這個受控資料庫所屬的實例故障轉移群組資源標識符。

properties.lastBackupName

string

還原此受控資料庫的最後一個備份檔名。

properties.longTermRetentionBackupResourceId

string

要用於還原此受控資料庫之長期保留備份的名稱。

properties.recoverableDatabaseId

string

與這個資料庫建立作業相關聯的可復原資料庫資源標識符。

properties.restorableDroppedDatabaseId

string

建立此資料庫時要還原的可還原已卸除資料庫資源標識符。

properties.restorePointInTime

string

條件。 如果 createMode 是 PointInTimeRestore,則需要此值。 指定將還原以建立新資料庫之源資料庫) (ISO8601 時間點。

properties.sourceDatabaseId

string

與此資料庫建立作業相關聯的源資料庫資源標識符。

properties.status

ManagedDatabaseStatus

資料庫的狀態。

properties.storageContainerSasToken

string

條件。 如果 createMode 為 RestoreExternalBackup,則需要此值。 指定記憶體容器 sas 令牌。

properties.storageContainerUri

string

條件。 如果 createMode 為 RestoreExternalBackup,則需要此值。 指定儲存此還原備份之記憶體容器的 URI。

tags

object

資源標籤。

type

string

資源類型。

ManagedDatabaseCreateMode

受控資料庫建立模式。 PointInTimeRestore:藉由還原現有資料庫的時間點備份來建立資料庫。 必須指定SourceDatabaseName、SourceManagedInstanceName和PointInTime。 RestoreExternalBackup:從外部備份文件還原來建立資料庫。 必須指定 Collation、StorageContainerUri 和 StorageContainerSasToken。 復原:藉由還原異地復寫備份來建立資料庫。 RecoverableDatabaseId 必須指定為可復原的資料庫資源標識符,才能還原。 RestoreLongTermRetentionBackup:從長期保留備份還原 (longTermRetentionBackupResourceId 所需的) 來建立資料庫。

名稱 類型 Description
Default

string

PointInTimeRestore

string

Recovery

string

RestoreExternalBackup

string

RestoreLongTermRetentionBackup

string

ManagedDatabaseStatus

資料庫的狀態。

名稱 類型 Description
Creating

string

Inaccessible

string

Offline

string

Online

string

Restoring

string

Shutdown

string

Updating

string