你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Databases - Create Or Update

创建新数据库或更新现有数据库。

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

URI 参数

名称 必需 类型 说明
databaseName
path True

string

数据库的名称。

resourceGroupName
path True

string

包含该资源的资源组名称。 可以从 Azure 资源管理器 API 或门户获取此值。

serverName
path True

string

服务器的名称。

subscriptionId
path True

string

用于标识 Azure 订阅的订阅 ID。

api-version
query True

string

要用于请求的 API 版本。

请求正文

名称 必需 类型 说明
location True

string

资源位置。

identity

DatabaseIdentity

数据库的 Azure Active Directory 标识。

properties.autoPauseDelay

integer

数据库自动暂停的时间(分钟)。 值为 -1 表示已禁用自动暂停

properties.catalogCollation

CatalogCollationType

元数据目录的排序规则。

properties.collation

string

数据库的排序规则。

properties.createMode

CreateMode

指定数据库创建模式。

默认值:常规数据库创建。

复制:将数据库创建为现有数据库的副本。 sourceDatabaseId 必须指定为源数据库的资源 ID。

辅助数据库:将数据库创建为现有数据库的辅助副本 (replica) 。 sourceDatabaseId 必须指定为现有主数据库的资源 ID。

PointInTimeRestore:通过还原现有数据库的时间点备份来创建数据库。 sourceDatabaseId 必须指定为现有数据库的资源 ID,并且必须指定 restorePointInTime。

恢复:通过还原异地复制的备份来创建数据库。 sourceDatabaseId 必须指定为要还原的可恢复数据库资源 ID。

还原:通过还原已删除数据库的备份来创建数据库。 必须指定 sourceDatabaseId。 如果 sourceDatabaseId 是数据库的原始资源 ID,则必须指定 sourceDatabaseDeletionDate。 否则,sourceDatabaseId 必须是可还原的已删除数据库资源 ID,并且 sourceDatabaseDeletionDate 将被忽略。 还可以指定 restorePointInTime 从较早的时间点还原。

RestoreLongTermRetentionBackup:通过从长期保留保管库还原来创建数据库。 recoveryServicesRecoveryPointResourceId 必须指定为恢复点资源 ID。

DataWarehouse 版本不支持 Copy、Secondary 和 RestoreLongTermRetentionBackup。

properties.elasticPoolId

string

包含此数据库的弹性池的资源标识符。

properties.federatedClientId

string

用于跨租户每个数据库 CMK 方案的客户端 ID

properties.highAvailabilityReplicaCount

integer

与数据库关联的用于提供高可用性的辅助副本数。 不适用于弹性池中的超大规模数据库。

properties.isLedgerOn

boolean

此数据库是否为账本数据库,这意味着数据库中的所有表都是账本表。 注意:创建数据库后,无法更改此属性的值。

properties.licenseType

DatabaseLicenseType

要为此数据库申请的许可证类型。 LicenseIncluded如果需要许可证,或者BasePrice如果你有许可证并且有资格获得Azure 混合权益。

properties.longTermRetentionBackupResourceId

string

与此数据库的创建操作关联的长期保留备份的资源标识符。

properties.maintenanceConfigurationId

string

分配给数据库的维护配置 ID。 此配置定义将发生维护更新的时间段。

properties.maxSizeBytes

integer

以字节表示的数据库的最大大小。

properties.minCapacity

number

数据库始终分配的最小容量(如果未暂停)

properties.readScale

DatabaseReadScale

只读路由的状态。 如果启用,则在其连接字符串中将应用程序意向设置为只读的连接可能会路由到同一区域中的只读辅助副本 (replica) 。 不适用于弹性池中的超大规模数据库。

properties.recoverableDatabaseId

string

与此数据库的创建操作关联的可恢复数据库的资源标识符。

properties.recoveryServicesRecoveryPointId

string

与此数据库的创建操作关联的恢复点的资源标识符。

properties.requestedBackupStorageRedundancy

BackupStorageRedundancy

用于存储此数据库的备份的存储帐户类型。

properties.restorableDroppedDatabaseId

string

与此数据库的创建操作关联的可还原删除数据库的资源标识符。

properties.restorePointInTime

string

指定要还原以创建新数据库的源数据库的时间点 (ISO8601 格式) 。

properties.sampleName

SampleName

创建此数据库时要应用的示例架构的名称。

properties.secondaryType

SecondaryType

数据库的辅助类型(如果它是辅助数据库)。 有效值为 Geo 和 Named。

properties.sourceDatabaseDeletionDate

string

指定数据库被删除的时间。

properties.sourceDatabaseId

string

与此数据库的创建操作关联的源数据库的资源标识符。

properties.sourceResourceId

string

与此数据库的创建操作关联的源的资源标识符。

此属性仅支持 DataWarehouse 版本,并允许跨订阅还原。

指定 sourceResourceId 时,不得指定 sourceDatabaseId、recoverableDatabaseId、restoreableDroppedDatabaseId 和 sourceDatabaseDeletionDate,并且 CreateMode 必须为 PointInTimeRestore、Restore 或 Recover。

当 createMode 为 PointInTimeRestore 时,sourceResourceId 必须是现有数据库或现有 sql 池的资源 ID,并且必须指定 restorePointInTime。

当 createMode 为 Restore 时,sourceResourceId 必须是可还原的已删除数据库或可还原的已删除 sql 池的资源 ID。

当 createMode 为“恢复”时,sourceResourceId 必须是可恢复数据库或可恢复 sql 池的资源 ID。

当源订阅属于与目标订阅不同的租户时,“x-ms-authorization-auxiliary”标头必须包含源租户的身份验证令牌。 有关“x-ms-authorization-auxiliary”标头的更多详细信息,请参阅 https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant

properties.zoneRedundant

boolean

此数据库是否为区域冗余,这意味着此数据库的副本将分布在多个可用性区域。

sku

Sku

数据库 SKU。

SKU 列表可能因区域和支持产品/服务而异。 若要确定 SKU (包括 AZURE 区域中订阅可用的 SKU 名称、层/版本、系列和容量) ,请使用 Capabilities_ListByLocation REST API 或以下命令之一:

az sql db list-editions -l <location> -o table
Get-AzSqlServerServiceObjective -Location <location>
tags

object

资源标记。

响应

名称 类型 说明
200 OK

Database

已成功更新数据库。

201 Created

Database

已成功创建数据库。

202 Accepted

正在创建或更新数据库。

Other Status Codes

错误响应: ***

  • 400 InvalidDatabaseCreateOrUpdateRequest - 创建或更新数据库操作的请求正文无效。

  • 400 InvalidResourceId - 资源标识符无效。

  • 400 InvalidSourceDatabaseId - 源数据库标识符无效。

  • 400 MismatchingResourceGroupNameWithUrl - 提供的资源组名称与 URL 中的名称不匹配。

  • 400 MismatchingServerNameWithUrl - 提供的服务器名称与 URL 中的名称不匹配。

  • 400 MismatchingSubscriptionWithUrl - 提供的订阅与 URL 中的订阅不匹配。

  • 400 MissingCollation - 需要排序规则。

  • 400 MissingMaxSizeBytes - MaxSizeBytes 是必需的。

  • 400 MissingSkuName - SKU 名称是必需的。

  • 400 MissingSourceDatabaseId - 缺少源数据库标识符。

  • 400 InvalidLicenseType - 指定的许可证类型无效。

  • 400 InvalidSkuName - SKU 名称无效。

  • 400 不匹配的SkuNameAndCapacity - SKU 名称和容量不匹配。

  • 400 不匹配的SkuNameAndTier - SKU 名称和层不匹配。

  • 400 不匹配的SkuNameAndFamily - SKU 名称和系列不匹配。

  • 400 LedgerNotAllowedWithSpecifiedCreateMode - 指定的创建模式不允许使用 IsLedgerOn。

  • 400 LedgerNotAllowedOnSampleDatabase - 对于示例数据库,不允许使用 IsLedgerOn 创建数据库。

  • 400 DatabaseNameDoesNotMatchSourceDatabaseId - 指定的数据库名称与 sourceDatabaseId 中的数据库名称不匹配。

  • 400 ElasticPoolNotSupportedForExternalBackupRestore - 外部备份还原不支持弹性池

  • 400 InvalidRecoverableDatabaseId - 无效的可恢复数据库标识符。

  • 400 InvalidRecoveryServicesRecoveryPointId - 无效的恢复服务恢复点标识符。

  • 400 InvalidRestorableDroppedDatabaseDeletionDate - 给定的可还原删除数据库删除日期无效

  • 400 InvalidRestorableDroppedDatabaseId - 无效的可还原删除数据库标识符

  • 400 MissingRecoverableDatabaseId - 缺少可恢复的数据库标识符。

  • 400 MissingRecoveryServicesRecoveryPointId - 缺少恢复服务恢复点 ID。

  • 400 MissingRestorableDroppedDatabaseId - Missing restorableDroppedDatabaseId

  • 400 MissingRestorePointInTime - 缺少还原时间点

  • 400 MissingSourceDatabaseDeletionDate - 缺少源数据库删除日期

  • 400 MissingStorageContainerSasToken - 缺少存储容器 SAS 令牌

  • 400 MissingStorageContainerUri - 缺少存储容器 URI

  • 400 RestoreableDroppedDatabaseIdGivenForRestoreWithSourceDatabaseId - 在还原创建模式下已提供 sourceDatabaseId 时,无法指定 restoreableDroppedDatabaseId

  • 400 MultipleIdentitiesOnDatabase - 在数据库级别仅支持一个用户分配的托管标识。

  • 400 MultipleIdentityDelegationsOnDatabase - 在数据库级别仅支持一个标识委派。

  • 400 MissingPrimaryDelegatedIdentityClientId - 若要使用委托标识,请提供主要委托标识客户端 ID。

  • 400 InvalidStandbyGeoReadScale - 用户尝试在不支持它的备用异地数据库上启用读取缩放。

  • 400 PerDatabaseCMKKeyRotationAttemptedWhileOldThumbprintInUse - 当活动事务保留使用旧密钥加密的日志时,将阻止 TDE 保护器在数据库级别的密钥轮换。 有关解决此问题的可能策略,请参阅 aka.ms/azuresqldbkeyrotation。

  • 400 TierChangeUnsupportedDueToMemoryOptimizedObject - 数据库无法更新其 SKU,因为它具有内存优化对象。

  • 400 PerDBCMKNotSupportedWithLTR - 在数据库上启用长期备份保留时,不支持数据库级 CMK。

  • 400 SourceServerNotFound - CreateDatabaseAsCopy API 调用中提供的源数据库 ID 的服务器部分不会映射到现有服务器。

  • 400 ElasticPoolOverStorageUsage - 尝试在达到弹性池的存储限制时将数据写入数据库。

  • 400 InvalidDatabaseCreateMode - 创建数据库的请求无效。

  • 400 MissingAsymmetricKeyOnTargetServer - 目标服务器无权访问非对称密钥。

  • 400 MismatchingSubscriptionWithUrl - 提供的订阅与 URL 中的订阅不匹配。

  • 400 MultipleDroppedDatabasesWithTheSameName - 在服务器上发现了多个同名的已删除数据库。

  • 400 InvalidAddSecondaryPermission - 用户没有足够的权限在指定服务器上添加辅助数据库。

  • 400 AzureKeyVaultClientError - Azure 密钥保管库客户端遇到错误。

  • 400 UnsupportedServiceName - 指定的名称是无效名称,因为它包含一个或多个不受支持的 unicode 字符。

  • 400 AzureKeyVaultClientInfoError - 获取 Azure 密钥保管库客户端的信息时出错。

  • 400 CurrentDatabaseLogSizeExceedsMaxSize - 用户尝试将数据库更改为最大日志大小低于当前使用情况的 SKU。

  • 400 IsLedgerDatabaseIsNotSupportedOnResourceType - 此资源类型不支持更改账本属性。

  • 400 InvalidBackupStorageAccountType - 用户在创建/更新数据库期间传递了 zrs/lrs,但由于客户未列入允许列表或 zrs 在指定区域中不可用而失败。

  • 400 CannotUpdateToFreeDatabase - 不支持将数据库更新到免费 SKU。

  • 400 DatabaseInvalidSkuPropertyCombination - 请求的 SKU 的属性不一致。 请检查指定了有效的组合。 有关详细信息,请参阅 https://docs.microsoft.com/en-us/rest/api/sql/capabilities/listbylocation#serviceobjectivecapability

  • 400 DatabaseNamedReplicaPerDatabaseLimitExceeded - 用户尝试创建超过每个主数据库允许数量的命名副本 (replica)

  • 400 UnsupportedBackupStorageRedundancyForEdition - 版本不支持请求的备份存储冗余

  • 400 DatabaseIsCurrentlyPinned - Microsoft 已将数据库固定SQL Server引擎版本。 为了确保数据库不会遇到生产问题,将阻止数据库的任何将来缩放操作,直到取消固定。 请联系 Microsoft 支持部门获取有关缩放的帮助。

  • 400 RestoreTargetEditionSizeInsufficient - 用户尝试将数据库还原到小于源当前分配大小的版本。

  • 400 InvalidSku - 用户指定的 SKU 无效。

  • 400 InvalidTierSkuCombination - 指定的层不支持指定的 SKU。

  • 400 ServerNotFound - 找不到请求的服务器。

  • 400 UnsupportedBackupStorageRedundancy - 目标区域中不支持指定的备份存储冗余。

  • 400 InvalidIdentityId - 提供的一个或多个标识 id (s) 是无效的 ARM 资源 ID (s) 。 请输入有效 id () ,然后重试。

  • 400 LTRSterlingToVldbMigrationNotSupported - 无法将数据库的服务目标更改为超大规模,因为超大规模尚不支持长期保留。 请在数据库上禁用长期保留,然后重试。

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

  • 400 FeatureDisabledOnSelectedEdition - 用户尝试使用在当前数据库版本上禁用的功能。

  • 400 OfferDisabledOnSubscription - 订阅套餐类型被限制为预配请求的资源。

  • 400 UnableToCreateGeoChain - 用户尝试创建辅助数据库 (链接) 即使已配置自动上传账本摘要

  • 400 InvalidNumberOfIdentities - 数据库级别仅支持一个用户分配的托管标识。

  • 400 DatabaseNamedReplicaChainingNotAllowed - 用户尝试创建命名副本 (replica) 的命名副本 (replica) ,这是不允许的。

  • 400 DatabaseNamedReplicaInvalidOperation - 用户在命名副本 (replica) 上尝试了不受支持的操作。

  • 400 DatabaseNamedReplicaInvalidSourceDatabase - 用户尝试在与源数据库不同的订阅或区域中创建命名副本 (replica) 。

  • 400 InvalidTargetSubregion - 不可读辅助数据库的目标服务器不在 DR 配对的 Azure 区域中。

  • 400 CannotAssignIdentityToMaster - 无法向系统数据库分配标识。 不能将数据库标识分配给“master”、“model”、“tempdb”、“msdb”或“resource”数据库。

  • 400 PerDatabaseCMKDWNotSupported - Datawarehouse 版本不支持数据库级 CMK 预览版。

  • 400 DatabaseCreationBlockedForNonActivatedCMKServer - 启用 CMK 的工作区将阻止 SQL 池创建,直到激活工作区。 首先,启用清除保护,并授予工作区托管标识所需的权限, (获取、包装密钥、取消包装密钥) 工作区密钥的 Azure 密钥保管库。 接下来,在授予访问权限后激活工作区。

  • 400 PartnerServerNotCompatible - 用户尝试将数据库从 SAWA V1 服务器复制到 Sterling 服务器,反之亦然。

  • 400 IncorrectReplicationLinkState - 操作预期数据库在复制链接上处于预期状态。

  • 400 TargetElasticPoolDoesNotExist - 服务器上不存在弹性池。

  • 400 ElasticPoolSkuCombinationInvalid - 仅当 SKU 指定为“ElasticPool”时,才能一起指定弹性池和 SKU。

  • 400 ElasticPoolTierCombinationInvalid - 数据库层不同于弹性池服务层。

  • 400 ElasticPoolNameRequired - 用户尝试创建数据库或将数据库更新为弹性池服务目标,但未指定弹性池的名称。

  • 400 MissingThumbprintCrm - CRM 数据库的还原操作失败,因为缺少所需的 TDE 证书。 请对现有弹性池重试还原操作。

  • 400 ElasticPoolOverStorage - 在达到弹性池的存储限制时尝试将数据写入数据库。

  • 400 ElasticPoolInconsistentDtuGuaranteeSettings - 尝试为超过弹性池请求的 DTU 的数据库提供 DTU 最小值。

  • 400 RestoreTargetEditionSizeInsufficientV2 - 用户尝试将数据库还原到比已还原数据库分配大小小的版本。

  • 400 TierChangeUnsupportedDueToCDCEnabledDatabase - 数据库无法更新其 SKU,因为它已启用 CDC。

  • 400 ElasticPoolDatabaseCountOverLimit - 在达到弹性池的数据库计数限制时尝试创建数据库或将数据库添加到弹性池。

  • 400 ResourcePoolStorageLimitHitDuringRestore - 由于池中的剩余存储容量,无法将还原的数据库还原到资源池中。

  • 400 CannotChangeToOrFromDataWarehouseTier - 用户尝试将数据库的 SKU 从 DataWarehouse 层更改为非 DataWarehouse 层,反之亦然。

  • 400 CurrentDatabaseSizeExceedsMaxSize - 用户尝试将数据库的最大大小减小到小于当前使用情况的大小。

  • 400 PerDatabaseCMKRestoreNotSupported - 在预览中配置数据库级 CMK 时,不支持数据库还原。

  • 400 PerDatabaseCMKHSNotSupported - 超大规模版本不支持数据库级 CMK 预览版。

  • 400 AzureKeyVaultKeyDisabled - 由于禁用了 Azure 密钥保管库密钥,无法在服务器上完成该操作。

  • 400 PerDatabaseCMKGeoReplicationNotSupported - 在预览中配置数据库级 CMK 时,不支持异地复制和数据库复制。

  • 400 ElasticPoolDecreaseStorageLimitBelowUsage - 尝试将弹性池的存储限制降低到其存储使用量以下。

  • 400 AzureKeyVaultInvalidExpirationDate - 无法完成操作,因为 Azure 密钥保管库密钥过期日期无效。

  • 400 InvalidStandbyGeoEdition - 用户尝试创建基于 DTU 的备用地理位置。

  • 400 安全性AzureKeyVaultUrlNullOrEmpty - 无法完成操作,因为 Azure 密钥保管库 URI 为 null 或空。

  • 400 ElasticPoolInconsistentVcoreGuaranteeSettings - 每个数据库的数据库数和 VCore 最小值不能超过弹性池请求的 VCore 数。

  • 400 UpdateNotAllowedOnPausedDatabase - 用户尝试对暂停的数据库执行更新。

  • 400 GeoRestoreBackupStorageTypeNotSupported - 针对未配置为使用异地冗余备份存储的数据库发出数据库恢复请求时无效。

  • 400 RestoreHyperscaleToNonHyperscale - 不支持将超大规模数据库备份还原到非超大规模服务层级,反之亦然。

  • 400 SubscriptionDoesNotHaveAccessToServer - 订阅无权访问指定的服务器 ()

  • 400 RecoveryPointDoesNotExist - 指定的恢复点不存在或无效。

  • 400 AzureKeyVaultNoServerIdentity - 服务器标识未正确配置。

  • 400 InvalidMaxSizeTierCombination - 指定的层不支持指定的数据库最大大小。

  • 400 LtrBackupNotFound - 指定的长期保留备份不存在。

  • 400 AzureKeyVaultInvalidUri - 来自 Azure 密钥保管库的无效响应。 请使用有效的 Azure 密钥保管库 URI。

  • 400 InvalidPointInTime - 指定的时间点对数据库无效。

  • 400 AzureKeyVaultMissingPermissions - 服务器缺少 Azure 密钥保管库所需的权限。

  • 400 GeoRestoreCannotResolveTargetCluster - 无法解析服务器的目标群集

  • 400 InvalidReadScaleEdition - 用户尝试在不支持读取缩放的数据库类型上启用读取缩放。

  • 400 CannotSpecifyEditionOrSloWhenRestoringToPool - 还原到弹性池时不支持指定目标服务级别目标或版本。

  • 400 InvalidReadScaleUnits - 用户尝试提供不支持的读取缩放值。

  • 400 RestoreNotSupportedForGeoDrSecondary - 当前配置为异地辅助数据库的数据库不支持时间点还原和数据库恢复操作。

  • 400 SecurityAzureKeyVaultInvalidKeyName - 由于服务器密钥名称无效,操作无法完成。

  • 400 RegionDoesNotSupportVersion - 用户尝试在不支持该服务器版本的位置创建指定版本的服务器。

  • 400 GeoSecondaryMaxSizeUpdateFailed - 异地辅助数据库是不支持所请求的 maxsize 值的 SLO,或者异地辅助数据库位于不受支持的区域,或者异地辅助数据库上的更新操作已在进行中。

  • 400 AdalGenericError - 无法完成操作,因为遇到 Azure Active Directory 错误。

  • 400 AdalServicePrincipalNotFound - 无法完成操作,因为遇到“找不到 Azure Active Directory 库服务主体”错误。

  • 400 InvalidTier - 用户指定的层无效。

  • 400 AzureKeyVaultMalformedVaultUri - 提供的密钥保管库 URI 无效。

  • 400 CannotUseReservedDatabaseName - 此操作中无法使用保留的数据库名称。

  • 400 RequestedDatabaseSizeRequiresShrink - 用户尝试 ALTER DATABASE MODIFY MAXSIZE 将数据库的 MAXSIZE 修改为比当前大小更小的大小。

  • 400 CurrentDatabaseSizeExceedsDbMaxSize - 用户尝试将数据库的最大大小减小到小于当前使用情况的大小。

  • 400 InvalidServerName - 指定的服务器名称无效。

  • 400 CannotUseTrailingWhitespacesInDatabaseName - 数据库名称验证失败。

  • 400 SourceDatabaseEditionCouldNotBeUpgraded - 源数据库的版本不能高于目标数据库。

  • 400 SecurityAdalPrincipalCertExpiredError - 无法完成操作,因为 Azure 密钥保管库 主体证书已过期。

  • 400 TargetDatabaseEditionCouldNotBeDowngraded - 目标数据库的版本不能低于源数据库。

  • 400 UpdateNotAllowedIfGeoDrOperationInProgress - 不允许该操作,因为服务器{1}“”上的数据库“”{0}的复制或故障转移操作当前正在进行。

  • 400 InvalidCollation - 服务器无法识别排序规则。

  • 400 SecurityInvalidAzureKeyVaultRecoveryLevel - 提供的密钥保管库 URI 无效。

  • 400 KeyMaterialNotFoundOnRemoteServer - 远程服务器无权访问用作 TDE 保护器的密钥材料。

  • 400 AzureKeyVaultRsaKeyNotSupported - 提供的密钥保管库使用不受支持的 RSA 密钥大小或密钥类型。 支持的 RSA 密钥大小为 2048 或 3072,密钥类型为 RSA 或 RSA-HSM。

  • 400 SameKeyMaterialNotFoundOnRemoteServer - 辅助服务器没有主服务器的加密保护程序的密钥材料。

  • 400 ElasticPoolOverFileSpace - 弹性池中的文件空间不足。

  • 400 PartnerDBNotCompatibleForSGXEnclave - 仅当两个数据库都在 DC 系列硬件上运行时,才支持为已启用 enclave 的数据库设置 GeoDR 链接或更新 SLO。

  • 400 UpdateNotAllowedInCurrentReplicationState - 不允许对处于当前复制状态的数据库执行该操作。

  • 400 InvalidLicenseType - 用户尝试使用不受支持的许可证类型创建或更新数据库或弹性池。

  • 400 GeoReplicaLimitReached - 已达到每副本 (replica) 复制限制。

  • 400 UnsupportedCapacity - 用户尝试使用不支持的容量创建或更新数据库。

  • 400 ReplicationSourceAndTargetMustHaveSameName - 复制源数据库和目标数据库必须具有相同的名称。

  • 400 ProvisioningDisabled - 按原样显示来自资源操作授权者的错误消息,而不进行任何更改

  • 400 ReplicationSourceAndTargetMustBeInDifferentServers - 复制源数据库和目标数据库必须位于不同的逻辑服务器中。

  • 400 CannotUpdateIsLedgerDatabase - 无法更新现有数据库的账本属性。

  • 400 UnableToResolveRemoteServer - 由于服务器名称无效或 DNS 连接问题,无法解析远程伙伴服务器名称。

  • 400 RemoteDatabaseCopyPermission - 用户没有足够的权限在指定的服务器上创建数据库副本。

  • 400 CannotMoveOrDropSyncMetadataDatabase - 无法删除用作同步元数据数据库的数据库。

  • 400 SecurityAzureKeyVaultGeoChainError - 使用 Azure 密钥保管库 (BYOK) 启用透明数据加密时,不支持创建辅助 (称为链接) 的过程。

  • 400 RestoreToFreeEditionNotSupported - 还原和 GeoRestore 目标不能是免费数据库。

  • 400 CannotMoveOrDropJobAccountDatabase - 无法删除与作业帐户关联的数据库。

  • 400 RestoreNotSupportedForFreeEdition - 免费数据库不支持还原和 GeoRestore。

  • 400 JobAgentDatabaseEditionUnsupported - 不支持将指定数据库的服务级别目标用作作业代理数据库。

  • 400 InvalidDroppedDatabase - 已删除的源数据库在支持的恢复期内不存在于服务器上。

  • 400 InvalidLiveDatabase - 源数据库在支持的恢复期内不存在于服务器上。 如果要还原已删除的数据库,请指定其删除日期。

  • 400 InvalidVldbRecoverySlo - 超大规模版本恢复要求源数据库和目标数据库都使用超大规模服务级别目标。

  • 400 SourceDatabaseNotFound - 源数据库不存在。

  • 400 InvalidVldbRestoreSlo - 超大规模版本时间点还原要求源数据库和目标数据库都使用超大规模服务级别目标。

  • 400 CannotSpecifyPoolOrSlo - 版本不支持指定弹性池和/或更改服务级别目标或版本。

  • 400 InvalidPublicMaintenanceConfiguration - 用户尝试指定无法转换为内部 ID 的公共维护配置, (格式不正确或区域) 错误。

  • 400 MaintenanceWindowNotSupportedForNamedReplica - 用户尝试使用不支持的非默认维护时段创建或更新名为 副本 (replica) 。

  • 400 ChangeUnsupportedOnEntity - 用户尝试对给定实体执行不受支持的创建/更新/删除操作。

  • 400 LongTermRetentionMigrationRequestNotSupported - 不允许订阅 LTR 备份迁移功能。

  • 400 LongTermRetentionMigrationCrossClusterRequestNotSupported - 不允许源订阅和目标订阅针对 LTR 备份复制功能进行通信。

  • 400 LongTermRetentionMigrationParameterMissing - 操作缺少必需的参数。

  • 400 LongTermRetentionMigrationSameServerNotSupported - 不支持使用 LTR 复制功能在同一服务器中复制 LTR 备份。

  • 400 LongTermRetentionMigrationTargetServerNotFound - 目标服务器不存在或未准备好执行 LTR 备份复制操作。

  • 400 LongTermRetentionMigrationTargetDatabaseNotFound - 服务器上不存在目标数据库。

  • 400 LongTermRetentionMigrationStorageTypeNotSupported - 目标区域中不支持指定的备份存储冗余。

  • 400 LongTermRetentionMigrationStorageMismatch - 数据库的活动备份冗余与客户请求的备份冗余不匹配。

  • 400 LongTermRetentionMigrationDatabaseTypeNotSupported - LTR 迁移仅支持托管实例和Azure SQL DB LTR 备份。

  • 400 LongTermRetentionMigrationBackupStorageRedundancyNotAllowed - LTR 复制操作不允许更改备份存储冗余。

  • 400 LongTermRetentionMigrationSubscriptionNotFound - 找不到订阅。

  • 404 OperationIdNotFound - ID 为 的操作不存在。

  • 404 SubscriptionDoesNotHaveServer - 找不到请求的服务器

  • 404 ServerNotInSubscriptionResourceGroup - 指定的服务器不存在于指定的资源组和订阅中。

  • 404 DatabaseDoesNotExist - 用户已指定此服务器实例上不存在的数据库名称。

  • 404 ServerNotInSubscriptionResourceGroup - 指定的服务器不存在于指定的资源组和订阅中。

  • 404 SubscriptionNotFound - 找不到请求的订阅。

  • 404 ServerNotInSubscription - 指定的服务器不存在于指定的订阅中。

  • 404 CannotFindObject - 找不到对象,因为它不存在或您没有权限

  • 404 LongTermRetentionMigrationBackupNotFound - 指定的 LTR 备份不存在。

  • 405 UnsupportedReplicationOperation - 对数据库启动了不受支持的复制操作。

  • 409 OperationCancelled - 用户已取消操作。

  • 409 操作中断 - 无法完成对资源的操作,因为同一资源上的另一个操作中断了该操作。

  • 409 FreeDbAlreadyExists - 每个区域的订阅只能存在一个免费数据库。

  • 409 ConflictingServerOperation - 服务器当前正在进行操作。

  • 409 SubscriptionDisabled - 订阅已禁用。

  • 409 ConflictingSystemOperationInProgress - 数据库上的系统维护操作正在进行中,后续操作需要等待完成。

  • 409 ConflictRequestToUpdateBackupRedundancy - 更改备份存储冗余的冲突请求仍在进行中。

  • 409 SkuAssignmentInProgress - 无法处理当前分配请求,因为以前的请求尚未完成。

  • 409 DatabaseElasticPoolMaintenanceConflict - 用户尝试使用与数据库弹性池的维护配置冲突的指定维护配置创建或更新数据库。

  • 409 ServerDtuQuotaExceeded - 无法执行操作,因为服务器将超过允许的数据库吞吐量单位配额。

  • 409 UnableToAlterDatabaseInReplication - 复制关系中数据库上的用户更改版本。

  • 409 SubscriptionVcoreQuotaExceeded - 无法执行操作,因为订阅将超过允许的 vCore 配额。

  • 409 CurrentMemoryUsageExceedsSkuQuota - 用户尝试了由于资源消耗较高而无法完成的 SKU 更新操作。

  • 409 ServerKeyNameAlreadyExists - 服务器上已存在服务器密钥。

  • 409 ServerKeyUriAlreadyExists - 服务器上已存在服务器密钥 URI。

  • 409 ServerKeyDoesNotExists - 服务器密钥不存在。

  • 409 UpdateSloInProgress - 在 SLO 更新正在进行时,用户尝试启动不兼容的操作。

  • 409 UpdateSloFailedDatabaseTooBusy - 更新 SLO 操作无法完成,因为数据库太忙。

  • 409 ElasticPoolBusy - 在忙的弹性池上尝试了管理操作。

  • 409 AzureKeyVaultKeyNameNotFound - 操作无法完成,因为 Azure 密钥保管库密钥名称不存在。

  • 409 AzureKeyVaultKeyInUse - 服务器当前正在使用密钥。

  • 409 ServerDisabled - 服务器已禁用。

  • 409 冲突的DatabaseOperation - 数据库上已经有一些操作,当前操作应等到操作完成。

  • 409 SimultaneousSkuChangeNotAllowed - 服务目标更改操作不能同时在复制关系的两个数据库上运行。

  • 409 TargetElasticPoolBeingUpdated - 无法启动弹性池的更新,因为此弹性池中的某个数据库正在进行复制操作

  • 409 InvalidOperationForDatabaseNotInReplicationRelationship - 对已处于复制关系中的数据库执行复制种子设定操作。

  • 409 InvalidOperationForDatabaseInReplicationRelationship - 对已在复制关系中的数据库执行复制种子设定操作。

  • 409 DuplicateGeoDrRelation - 数据库已处于复制关系中。 这是重复的请求。

  • 409 DatabaseCopyLimitPerReplicaReached - 用户已达到并发数据库副本的限制。

  • 409 RemoteDatabaseExists - 目标服务器上已存在目标数据库名称。

  • 409 LongTermRetentionMigrationRequestConflict - 此 LTR 备份上的冲突操作仍在进行中。

  • 409 LongTermRetentionMigrationBackupConflict - 存在目标数据库的另一个备份时间相同的 LTR 备份。

  • 429 SubscriptionTooManyCreateUpdateRequests - 超出可用资源可处理的最大请求数的请求数。

  • 429 SubscriptionTooManyRequests - 超出可用资源可处理的最大请求数的请求数。

  • 429 SubscriptionTooManyCreateUpdateRequests - 超出可用资源可处理的最大请求数的请求数。

  • 429 SubscriptionTooManyRequests - 超出可用资源可处理的最大请求数的请求数。

  • 500 OperationTimedOut - 操作超时并自动回滚。 请重试该操作。

  • 500 ActivateOrDeactivateWorkflowThrottling - 激活或停用工作流失败,因为并发工作流太多

  • 500 LongTermRetentionMigrationRequestFailedToStartOnTarget - 无法在目标区域中启动 LTR 备份复制请求。

  • 500 LongTermRetentionMigrationRequestCopyFailed - LTR 备份 Blob 的复制操作失败。

  • 500 LongTermRetentionMigrationRestoreVerExceeded - 还原验证在达到最大尝试次数后失败。

  • 500 LongTermRetentionMigrationRestoreVerFailed - 还原验证失败。

  • 503 TooManyRequests - 超出可用资源可处理的最大请求数的请求数。

  • 503 TooManyRequests - 超出可用资源可处理的最大请求数的请求数。

  • 503 AzureKeyVaultConnectionFailed - 无法完成该操作在服务器上,因为尝试连接到 Azure 密钥保管库失败

  • 503 AzureKeyVaultGenericConnectionError - 无法完成该操作,因为尝试检索密钥保管库信息 时遇到错误。

  • 503 DatabaseUnavailable - 操作失败,因为数据库不可用。

  • 504 RequestTimeout - 服务请求超出允许的超时。

示例

Creates a data warehouse database as a cross-subscription restore from a backup of a dropped database.
Creates a data warehouse database as a cross-subscription restore from a geo-backup.
Creates a data warehouse database as a cross-subscription restore from a restore point of an existing database.
Creates a database as a copy.
Creates a database as an on-line secondary.
Creates a database as named replica secondary.
Creates a database from PointInTimeRestore.
Creates a database with default mode.
Creates a database with ledger on.
Creates a database with minimum number of parameters.
Creates a database with preferred maintenance window.
Creates a database with specified backup storage redundancy.
Creates a VCore database by specifying service objective name.
Creates a VCore database by specifying sku name and capacity.

Creates a data warehouse database as a cross-subscription restore from a backup of a dropped database.

Sample Request

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

{
  "location": "southeastasia",
  "properties": {
    "createMode": "Restore",
    "sourceResourceId": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/restorableDroppedDatabases/srcdw,131403269876900000"
  }
}

Sample Response

{
  "sku": {
    "name": "DataWarehouse",
    "tier": "DataWarehouse",
    "capacity": 9000
  },
  "kind": "v12.0,user,datawarehouse,gen2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 263882790666240,
    "status": "Online",
    "databaseId": "188784c9-d602-4684-86cf-e67b6f03551a",
    "creationDate": "2022-01-24T06:46:14.99Z",
    "currentServiceObjectiveName": "DW1000c",
    "requestedServiceObjectiveName": "DW1000c",
    "defaultSecondaryLocation": "eastus",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "currentSku": {
      "name": "DataWarehouse",
      "tier": "DataWarehouse",
      "capacity": 9000
    },
    "currentBackupStorageRedundancy": "Geo"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw",
  "name": "testdw",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "DataWarehouse",
    "tier": "DataWarehouse",
    "capacity": 9000
  },
  "kind": "v12.0,user,datawarehouse,gen2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 263882790666240,
    "status": "Online",
    "databaseId": "188784c9-d602-4684-86cf-e67b6f03551a",
    "creationDate": "2022-01-24T06:46:14.99Z",
    "currentServiceObjectiveName": "DW1000c",
    "requestedServiceObjectiveName": "DW1000c",
    "defaultSecondaryLocation": "eastus",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "currentSku": {
      "name": "DataWarehouse",
      "tier": "DataWarehouse",
      "capacity": 9000
    },
    "currentBackupStorageRedundancy": "Geo"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw",
  "name": "testdw",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a data warehouse database as a cross-subscription restore from a geo-backup.

Sample Request

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

{
  "location": "westus",
  "properties": {
    "createMode": "Recovery",
    "sourceResourceId": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-EastUS/providers/Microsoft.Sql/servers/srcsvr/recoverabledatabases/srcdw"
  }
}

Sample Response

{
  "sku": {
    "name": "DataWarehouse",
    "tier": "DataWarehouse",
    "capacity": 9000
  },
  "kind": "v12.0,user,datawarehouse,gen2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 263882790666240,
    "status": "Online",
    "databaseId": "188784c9-d602-4684-86cf-e67b6f03551a",
    "creationDate": "2022-01-24T06:46:14.99Z",
    "currentServiceObjectiveName": "DW1000c",
    "requestedServiceObjectiveName": "DW1000c",
    "defaultSecondaryLocation": "eastus",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "currentSku": {
      "name": "DataWarehouse",
      "tier": "DataWarehouse",
      "capacity": 9000
    },
    "currentBackupStorageRedundancy": "Geo"
  },
  "location": "westus",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-WestUS/providers/Microsoft.Sql/servers/testsvr/databases/testdw",
  "name": "testdw",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "DataWarehouse",
    "tier": "DataWarehouse",
    "capacity": 9000
  },
  "kind": "v12.0,user,datawarehouse,gen2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 263882790666240,
    "status": "Online",
    "databaseId": "188784c9-d602-4684-86cf-e67b6f03551a",
    "creationDate": "2022-01-24T06:46:14.99Z",
    "currentServiceObjectiveName": "DW1000c",
    "requestedServiceObjectiveName": "DW1000c",
    "defaultSecondaryLocation": "eastus",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "currentSku": {
      "name": "DataWarehouse",
      "tier": "DataWarehouse",
      "capacity": 9000
    },
    "currentBackupStorageRedundancy": "Geo"
  },
  "location": "westus",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-WestUS/providers/Microsoft.Sql/servers/testsvr/databases/testdw",
  "name": "testdw",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a data warehouse database as a cross-subscription restore from a restore point of an existing database.

Sample Request

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

{
  "location": "southeastasia",
  "properties": {
    "createMode": "PointInTimeRestore",
    "sourceResourceId": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/databases/srcdw",
    "restorePointInTime": "2022-01-22T05:35:31.503Z"
  }
}

Sample Response

{
  "sku": {
    "name": "DataWarehouse",
    "tier": "DataWarehouse",
    "capacity": 9000
  },
  "kind": "v12.0,user,datawarehouse,gen2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 263882790666240,
    "status": "Online",
    "databaseId": "188784c9-d602-4684-86cf-e67b6f03551a",
    "creationDate": "2022-01-24T06:46:14.99Z",
    "currentServiceObjectiveName": "DW1000c",
    "requestedServiceObjectiveName": "DW1000c",
    "defaultSecondaryLocation": "eastus",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "currentSku": {
      "name": "DataWarehouse",
      "tier": "DataWarehouse",
      "capacity": 9000
    },
    "currentBackupStorageRedundancy": "Geo"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw",
  "name": "testdw",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "DataWarehouse",
    "tier": "DataWarehouse",
    "capacity": 9000
  },
  "kind": "v12.0,user,datawarehouse,gen2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 263882790666240,
    "status": "Online",
    "databaseId": "188784c9-d602-4684-86cf-e67b6f03551a",
    "creationDate": "2022-01-24T06:46:14.99Z",
    "currentServiceObjectiveName": "DW1000c",
    "requestedServiceObjectiveName": "DW1000c",
    "defaultSecondaryLocation": "eastus",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "currentSku": {
      "name": "DataWarehouse",
      "tier": "DataWarehouse",
      "capacity": 9000
    },
    "currentBackupStorageRedundancy": "Geo"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw",
  "name": "testdw",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database as a copy.

Sample Request

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

{
  "location": "southeastasia",
  "sku": {
    "name": "S0",
    "tier": "Standard"
  },
  "properties": {
    "createMode": "Copy",
    "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"
  }
}

Sample Response

{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbcopy",
  "name": "dbcopy",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbcopy",
  "name": "dbcopy",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database as an on-line secondary.

Sample Request

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

{
  "location": "southeastasia",
  "sku": {
    "name": "S0",
    "tier": "Standard"
  },
  "properties": {
    "createMode": "Secondary",
    "secondaryType": "Geo",
    "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb"
  }
}

Sample Response

{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "secondaryType": "Geo",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "secondaryType": "Geo",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database as named replica secondary.

Sample Request

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

{
  "location": "southeastasia",
  "sku": {
    "name": "HS_Gen4",
    "tier": "Hyperscale",
    "capacity": 2
  },
  "properties": {
    "createMode": "Secondary",
    "secondaryType": "Named",
    "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb"
  }
}

Sample Response

{
  "sku": {
    "name": "HS_Gen4",
    "tier": "Hyperscale",
    "family": "Gen4",
    "capacity": 2
  },
  "kind": "v12.0,user,vcore,hyperscale",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": -1,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "HS_Gen4",
      "tier": "Hyperscale",
      "family": "Gen4",
      "capacity": 2
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "HS_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "HS_Gen4_2",
    "highAvailabilityReplicaCount": 0,
    "licenseType": "LicenseIncluded",
    "secondaryType": "Named",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "HS_Gen4",
    "tier": "Hyperscale",
    "family": "Gen4",
    "capacity": 2
  },
  "kind": "v12.0,user,vcore,hyperscale",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": -1,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "HS_Gen4",
      "tier": "Hyperscale",
      "family": "Gen4",
      "capacity": 2
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "HS_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "HS_Gen4_2",
    "highAvailabilityReplicaCount": 0,
    "licenseType": "LicenseIncluded",
    "secondaryType": "Named",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database from PointInTimeRestore.

Sample Request

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

{
  "location": "southeastasia",
  "properties": {
    "createMode": "PointInTimeRestore",
    "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
    "restorePointInTime": "2020-10-22T05:35:31.503Z"
  }
}

Sample Response

{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "2463ef48-53e2-4c26-9781-2d7138080bfd",
    "creationDate": "2020-10-23T20:31:35.807Z",
    "currentServiceObjectiveName": "S0",
    "requestedServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "SoutheastAsia",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "earliestRestoreDate": "2020-10-23T20:47:37Z",
    "readScale": "Disabled",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isLedgerOn": false
  },
  "location": "SoutheastAsia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbpitr",
  "name": "dbpitr",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "2463ef48-53e2-4c26-9781-2d7138080bfd",
    "creationDate": "2020-10-23T20:31:35.807Z",
    "currentServiceObjectiveName": "S0",
    "requestedServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "SoutheastAsia",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "earliestRestoreDate": "2020-10-23T20:47:37Z",
    "readScale": "Disabled",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isLedgerOn": false
  },
  "location": "SoutheastAsia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbpitr",
  "name": "dbpitr",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database with default mode.

Sample Request

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

{
  "location": "southeastasia",
  "sku": {
    "name": "S0",
    "tier": "Standard"
  },
  "properties": {
    "createMode": "Default",
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 1073741824
  }
}

Sample Response

{
  "sku": {
    "name": "S0",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "isLedgerOn": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "S0",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "isLedgerOn": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database with ledger on.

Sample Request

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

{
  "location": "southeastasia",
  "properties": {
    "isLedgerOn": true
  }
}

Sample Response

{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "S0",
    "currentBackupStorageRedundancy": "Geo",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "zoneRedundant": false,
    "isLedgerOn": true
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Zone",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Zone",
    "requestedServiceObjectiveName": "S0",
    "zoneRedundant": false,
    "isLedgerOn": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database with minimum number of parameters.

Sample Request

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

{
  "location": "southeastasia"
}

Sample Response

{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "S0",
    "currentBackupStorageRedundancy": "Geo",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database with preferred maintenance window.

Sample Request

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

{
  "location": "southeastasia",
  "sku": {
    "name": "S2",
    "tier": "Standard"
  },
  "properties": {
    "createMode": "Default",
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 1073741824,
    "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"
  }
}

Sample Response

{
  "sku": {
    "name": "S2",
    "tier": "Standard"
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "S2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "earliestRestoreDate": "2020-08-29T06:41:18.283Z",
    "readScale": "Disabled",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 50
    },
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1",
    "isLedgerOn": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "S2",
    "tier": "Standard"
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "S2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "earliestRestoreDate": "2020-08-29T06:41:18.283Z",
    "readScale": "Disabled",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 50
    },
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1",
    "isLedgerOn": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database with specified backup storage redundancy.

Sample Request

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

{
  "location": "southeastasia",
  "properties": {
    "requestedBackupStorageRedundancy": "Zone"
  }
}

Sample Response

{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Zone",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Zone",
    "requestedServiceObjectiveName": "S0",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Zone",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Zone",
    "requestedServiceObjectiveName": "S0",
    "zoneRedundant": false,
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a VCore database by specifying service objective name.

Sample Request

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

{
  "location": "southeastasia",
  "sku": {
    "name": "BC",
    "family": "Gen4",
    "capacity": 2
  }
}

Sample Response

{
  "sku": {
    "name": "BC_Gen4",
    "tier": "BusinessCritical",
    "family": "Gen4",
    "capacity": 2
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "BC_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "licenseType": "LicenseIncluded",
    "maxLogSizeBytes": 104857600,
    "readScale": "Enabled",
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "currentSku": {
      "name": "BC_Gen4",
      "tier": "BusinessCritical",
      "capacity": 2
    }
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "BC_Gen4",
    "tier": "BusinessCritical",
    "family": "Gen4",
    "capacity": 2
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "BC_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "licenseType": "LicenseIncluded",
    "maxLogSizeBytes": 104857600,
    "readScale": "Enabled",
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "isLedgerOn": false,
    "currentSku": {
      "name": "BC_Gen4",
      "tier": "BusinessCritical",
      "capacity": 2
    }
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a VCore database by specifying sku name and capacity.

Sample Request

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

{
  "location": "southeastasia",
  "sku": {
    "name": "BC_Gen4",
    "capacity": 2
  }
}

Sample Response

{
  "sku": {
    "name": "BC_Gen4",
    "tier": "BusinessCritical",
    "family": "Gen4",
    "capacity": 2
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "BC_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "licenseType": "LicenseIncluded",
    "maxLogSizeBytes": 104857600,
    "readScale": "Enabled",
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "currentSku": {
      "name": "BC_Gen4",
      "tier": "BusinessCritical",
      "capacity": 2
    }
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "BC_Gen4",
    "tier": "BusinessCritical",
    "family": "Gen4",
    "capacity": 2
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "BC_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "licenseType": "LicenseIncluded",
    "maxLogSizeBytes": 104857600,
    "readScale": "Enabled",
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "currentSku": {
      "name": "BC_Gen4",
      "tier": "BusinessCritical",
      "capacity": 2
    }
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

定义

名称 说明
BackupStorageRedundancy

用于存储此数据库的备份的存储帐户类型。

CatalogCollationType

元数据目录的排序规则。

CreateMode

指定数据库创建模式。

默认值:常规数据库创建。

复制:将数据库创建为现有数据库的副本。 sourceDatabaseId 必须指定为源数据库的资源 ID。

辅助数据库:将数据库创建为现有数据库的辅助副本 (replica) 。 sourceDatabaseId 必须指定为现有主数据库的资源 ID。

PointInTimeRestore:通过还原现有数据库的时间点备份来创建数据库。 sourceDatabaseId 必须指定为现有数据库的资源 ID,并且必须指定 restorePointInTime。

恢复:通过还原异地复制的备份来创建数据库。 sourceDatabaseId 必须指定为要还原的可恢复数据库资源 ID。

还原:通过还原已删除数据库的备份来创建数据库。 必须指定 sourceDatabaseId。 如果 sourceDatabaseId 是数据库的原始资源 ID,则必须指定 sourceDatabaseDeletionDate。 否则,sourceDatabaseId 必须是可还原的已删除数据库资源 ID,并且 sourceDatabaseDeletionDate 将被忽略。 还可以指定 restorePointInTime 从较早的时间点还原。

RestoreLongTermRetentionBackup:通过从长期保留保管库还原来创建数据库。 recoveryServicesRecoveryPointResourceId 必须指定为恢复点资源 ID。

DataWarehouse 版本不支持 Copy、Secondary 和 RestoreLongTermRetentionBackup。

Database

数据库资源。

DatabaseIdentity

资源的 Azure Active Directory 标识配置。

DatabaseIdentityType

标识类型

DatabaseLicenseType

要为此数据库申请的许可证类型。 LicenseIncluded如果需要许可证,或者BasePrice如果你有许可证并且有资格获得Azure 混合权益。

DatabaseReadScale

只读路由的状态。 如果启用,则在其连接字符串中将应用程序意向设置为只读的连接可能会路由到同一区域中的只读辅助副本 (replica) 。 不适用于弹性池中的超大规模数据库。

DatabaseStatus

数据库的状态。

DatabaseUserIdentity

资源的 Azure Active Directory 标识配置。

SampleName

创建此数据库时要应用的示例架构的名称。

SecondaryType

数据库的辅助类型(如果它是辅助数据库)。 有效值为 Geo 和 Named。

Sku

ARM 资源 SKU。

BackupStorageRedundancy

用于存储此数据库的备份的存储帐户类型。

名称 类型 说明
Geo

string

GeoZone

string

Local

string

Zone

string

CatalogCollationType

元数据目录的排序规则。

名称 类型 说明
DATABASE_DEFAULT

string

SQL_Latin1_General_CP1_CI_AS

string

CreateMode

指定数据库创建模式。

默认值:常规数据库创建。

复制:将数据库创建为现有数据库的副本。 sourceDatabaseId 必须指定为源数据库的资源 ID。

辅助数据库:将数据库创建为现有数据库的辅助副本 (replica) 。 sourceDatabaseId 必须指定为现有主数据库的资源 ID。

PointInTimeRestore:通过还原现有数据库的时间点备份来创建数据库。 sourceDatabaseId 必须指定为现有数据库的资源 ID,并且必须指定 restorePointInTime。

恢复:通过还原异地复制的备份来创建数据库。 sourceDatabaseId 必须指定为要还原的可恢复数据库资源 ID。

还原:通过还原已删除数据库的备份来创建数据库。 必须指定 sourceDatabaseId。 如果 sourceDatabaseId 是数据库的原始资源 ID,则必须指定 sourceDatabaseDeletionDate。 否则,sourceDatabaseId 必须是可还原的已删除数据库资源 ID,并且 sourceDatabaseDeletionDate 将被忽略。 还可以指定 restorePointInTime 从较早的时间点还原。

RestoreLongTermRetentionBackup:通过从长期保留保管库还原来创建数据库。 recoveryServicesRecoveryPointResourceId 必须指定为恢复点资源 ID。

DataWarehouse 版本不支持 Copy、Secondary 和 RestoreLongTermRetentionBackup。

名称 类型 说明
Copy

string

Default

string

OnlineSecondary

string

PointInTimeRestore

string

Recovery

string

Restore

string

RestoreExternalBackup

string

RestoreExternalBackupSecondary

string

RestoreLongTermRetentionBackup

string

Secondary

string

Database

数据库资源。

名称 类型 说明
id

string

资源 ID。

identity

DatabaseIdentity

数据库的 Azure Active Directory 标识。

kind

string

数据库类型。 这是用于Azure 门户体验的元数据。

location

string

资源位置。

managedBy

string

管理数据库的资源。

name

string

资源名称。

properties.autoPauseDelay

integer

数据库自动暂停的时间(分钟)。 值为 -1 表示已禁用自动暂停

properties.catalogCollation

CatalogCollationType

元数据目录的排序规则。

properties.collation

string

数据库的排序规则。

properties.createMode

CreateMode

指定数据库创建模式。

默认值:常规数据库创建。

复制:将数据库创建为现有数据库的副本。 sourceDatabaseId 必须指定为源数据库的资源 ID。

辅助数据库:将数据库创建为现有数据库的辅助副本 (replica) 。 sourceDatabaseId 必须指定为现有主数据库的资源 ID。

PointInTimeRestore:通过还原现有数据库的时间点备份来创建数据库。 sourceDatabaseId 必须指定为现有数据库的资源 ID,并且必须指定 restorePointInTime。

恢复:通过还原异地复制的备份来创建数据库。 sourceDatabaseId 必须指定为要还原的可恢复数据库资源 ID。

还原:通过还原已删除数据库的备份来创建数据库。 必须指定 sourceDatabaseId。 如果 sourceDatabaseId 是数据库的原始资源 ID,则必须指定 sourceDatabaseDeletionDate。 否则,sourceDatabaseId 必须是可还原的已删除数据库资源 ID,并且 sourceDatabaseDeletionDate 将被忽略。 还可以指定 restorePointInTime 从较早的时间点还原。

RestoreLongTermRetentionBackup:通过从长期保留保管库还原来创建数据库。 recoveryServicesRecoveryPointResourceId 必须指定为恢复点资源 ID。

DataWarehouse 版本不支持 Copy、Secondary 和 RestoreLongTermRetentionBackup。

properties.creationDate

string

数据库的创建日期 (ISO8601 格式) 。

properties.currentBackupStorageRedundancy

BackupStorageRedundancy

用于存储此数据库的备份的存储帐户类型。

properties.currentServiceObjectiveName

string

数据库的当前服务级别目标名称。

properties.currentSku

Sku

SKU 的名称和层。

properties.databaseId

string

数据库的 ID。

properties.defaultSecondaryLocation

string

此数据库的默认次要区域。

properties.earliestRestoreDate

string

这会记录可用于此数据库的最早还原日期和时间, (ISO8601 格式) 。

properties.elasticPoolId

string

包含此数据库的弹性池的资源标识符。

properties.failoverGroupId

string

此数据库所属的故障转移组资源标识符。

properties.federatedClientId

string

用于跨租户每个数据库 CMK 方案的客户端 ID

properties.highAvailabilityReplicaCount

integer

与数据库关联的用于提供高可用性的辅助副本数。 不适用于弹性池中的超大规模数据库。

properties.isInfraEncryptionEnabled

boolean

为此数据库启用了基础结构加密。

properties.isLedgerOn

boolean

此数据库是否为账本数据库,这意味着数据库中的所有表都是账本表。 注意:创建数据库后,无法更改此属性的值。

properties.licenseType

DatabaseLicenseType

要为此数据库申请的许可证类型。 LicenseIncluded如果需要许可证,或者BasePrice如果你有许可证并且有资格获得Azure 混合权益。

properties.longTermRetentionBackupResourceId

string

与此数据库的创建操作关联的长期保留备份的资源标识符。

properties.maintenanceConfigurationId

string

分配给数据库的维护配置 ID。 此配置定义将发生维护更新的时间段。

properties.maxLogSizeBytes

integer

此数据库的最大日志大小。

properties.maxSizeBytes

integer

以字节表示的数据库的最大大小。

properties.minCapacity

number

数据库始终分配的最小容量(如果未暂停)

properties.pausedDate

string

用户配置或操作暂停数据库的日期 (ISO8601 格式) 。 如果数据库已准备就绪,则为 Null。

properties.readScale

DatabaseReadScale

只读路由的状态。 如果启用,则在其连接字符串中将应用程序意向设置为只读的连接可能会路由到同一区域中的只读辅助副本 (replica) 。 不适用于弹性池中的超大规模数据库。

properties.recoverableDatabaseId

string

与此数据库的创建操作关联的可恢复数据库的资源标识符。

properties.recoveryServicesRecoveryPointId

string

与此数据库的创建操作关联的恢复点的资源标识符。

properties.requestedBackupStorageRedundancy

BackupStorageRedundancy

用于存储此数据库的备份的存储帐户类型。

properties.requestedServiceObjectiveName

string

数据库请求的服务级别目标名称。

properties.restorableDroppedDatabaseId

string

与此数据库的创建操作关联的可还原删除数据库的资源标识符。

properties.restorePointInTime

string

指定要还原以创建新数据库的源数据库的时间点 (ISO8601 格式) 。

properties.resumedDate

string

用户操作或数据库登录恢复数据库的日期 (ISO8601 格式) 。 如果数据库已暂停,则为 Null。

properties.sampleName

SampleName

创建此数据库时要应用的示例架构的名称。

properties.secondaryType

SecondaryType

数据库的辅助类型(如果它是辅助数据库)。 有效值为 Geo 和 Named。

properties.sourceDatabaseDeletionDate

string

指定数据库被删除的时间。

properties.sourceDatabaseId

string

与此数据库的创建操作关联的源数据库的资源标识符。

properties.sourceResourceId

string

与此数据库的创建操作关联的源的资源标识符。

此属性仅支持 DataWarehouse 版本,并允许跨订阅还原。

指定 sourceResourceId 时,不得指定 sourceDatabaseId、recoverableDatabaseId、restoreableDroppedDatabaseId 和 sourceDatabaseDeletionDate,并且 CreateMode 必须为 PointInTimeRestore、Restore 或 Recover。

当 createMode 为 PointInTimeRestore 时,sourceResourceId 必须是现有数据库或现有 sql 池的资源 ID,并且必须指定 restorePointInTime。

当 createMode 为 Restore 时,sourceResourceId 必须是可还原的已删除数据库或可还原的已删除 sql 池的资源 ID。

当 createMode 为“恢复”时,sourceResourceId 必须是可恢复数据库或可恢复 sql 池的资源 ID。

当源订阅属于与目标订阅不同的租户时,“x-ms-authorization-auxiliary”标头必须包含源租户的身份验证令牌。 有关“x-ms-authorization-auxiliary”标头的更多详细信息,请参阅 https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant

properties.status

DatabaseStatus

数据库的状态。

properties.zoneRedundant

boolean

此数据库是否为区域冗余,这意味着此数据库的副本将分布在多个可用性区域。

sku

Sku

数据库 SKU。

SKU 列表可能因区域和支持产品/服务而异。 若要确定 SKU (包括 AZURE 区域中订阅可用的 SKU 名称、层/版本、系列和容量) ,请使用 Capabilities_ListByLocation REST API 或以下命令之一:

az sql db list-editions -l <location> -o table
Get-AzSqlServerServiceObjective -Location <location>
tags

object

资源标记。

type

string

资源类型。

DatabaseIdentity

资源的 Azure Active Directory 标识配置。

名称 类型 说明
tenantId

string

Azure Active Directory 租户 ID。

type

DatabaseIdentityType

标识类型

userAssignedIdentities

<string,  DatabaseUserIdentity>

要使用的用户分配标识的资源 ID

DatabaseIdentityType

标识类型

名称 类型 说明
None

string

UserAssigned

string

DatabaseLicenseType

要为此数据库申请的许可证类型。 LicenseIncluded如果需要许可证,或者BasePrice如果你有许可证并且有资格获得Azure 混合权益。

名称 类型 说明
BasePrice

string

LicenseIncluded

string

DatabaseReadScale

只读路由的状态。 如果启用,则在其连接字符串中将应用程序意向设置为只读的连接可能会路由到同一区域中的只读辅助副本 (replica) 。 不适用于弹性池中的超大规模数据库。

名称 类型 说明
Disabled

string

Enabled

string

DatabaseStatus

数据库的状态。

名称 类型 说明
AutoClosed

string

Copying

string

Creating

string

Disabled

string

EmergencyMode

string

Inaccessible

string

Offline

string

OfflineChangingDwPerformanceTiers

string

OfflineSecondary

string

Online

string

OnlineChangingDwPerformanceTiers

string

Paused

string

Pausing

string

Recovering

string

RecoveryPending

string

Restoring

string

Resuming

string

Scaling

string

Shutdown

string

Standby

string

Starting

string

Stopped

string

Stopping

string

Suspect

string

DatabaseUserIdentity

资源的 Azure Active Directory 标识配置。

名称 类型 说明
clientId

string

Azure Active Directory 客户端 ID。

principalId

string

Azure Active Directory 主体 ID。

SampleName

创建此数据库时要应用的示例架构的名称。

名称 类型 说明
AdventureWorksLT

string

WideWorldImportersFull

string

WideWorldImportersStd

string

SecondaryType

数据库的辅助类型(如果它是辅助数据库)。 有效值为 Geo 和 Named。

名称 类型 说明
Geo

string

Named

string

Sku

ARM 资源 SKU。

名称 类型 说明
capacity

integer

特定 SKU 的容量。

family

string

如果服务具有不同代系的硬件(对于同一 SKU),则可以在此处进行捕获。

name

string

SKU 的名称,通常为字母 + 数字代码,例如 P3。

size

string

特定 SKU 的大小

tier

string

特定 SKU 的层或版本,例如“基本”、“高级”。