Databases - Update
更新现有数据库。
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}?api-version=2023-08-01URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 | 
|---|---|---|---|---|
| database | path | True | string | 数据库的名称。 | 
| resource | path | True | string | 包含资源的资源组的名称。 可以从 Azure 资源管理器 API 或门户获取此值。 | 
| server | path | True | string | 服务器的名称。 | 
| subscription | path | True | string | 标识 Azure 订阅的订阅 ID。 | 
| api-version | query | True | string | 要用于请求的 API 版本。 | 
请求正文
| 名称 | 类型 | 说明 | 
|---|---|---|
| identity | 数据库标识 | |
| properties.autoPauseDelay | integer (int32) | 数据库自动暂停的时间(以分钟为单位)。 -1 值表示禁用自动暂停 | 
| properties.catalogCollation | 元数据目录的排序规则。 | |
| properties.collation | string | 数据库的排序规则。 | 
| properties.createMode | 指定数据库创建模式。 默认值:常规数据库创建。 复制:将数据库创建为现有数据库的副本。 sourceDatabaseId 必须指定为源数据库的资源 ID。 辅助数据库:将数据库创建为现有数据库的次要副本。 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 (arm-id) | 包含此数据库的弹性池的资源标识符。 | 
| properties.encryptionProtector | string | 如果数据库配置了每个数据库客户管理的密钥,则数据库的 Azure 密钥保管库 URI。 | 
| properties.encryptionProtectorAutoRotation | boolean | 用于启用或禁用数据库加密保护程序 AKV 密钥自动轮换的标志。 | 
| properties.federatedClientId | string (uuid) | 用于每个数据库 CMK 方案的跨租户的客户端 ID | 
| properties.freeLimitExhaustionBehavior | 指定免费数据库使用每月免费限制时的行为。 AutoPause:当剩余月份的可用限制用尽时,数据库将自动暂停。 BillForUsage:在耗尽免费限制后,数据库将继续联机,并且将收取任何超额费用。 | |
| properties.highAvailabilityReplicaCount | integer (int32) | 与用于提供高可用性的业务关键版、高级版或超大规模版数据库关联的次要副本数。 不适用于弹性池中的“超大规模”数据库。 | 
| properties.isLedgerOn | boolean | 此数据库是否为账本数据库,这意味着数据库中的所有表都是账本表。 注意:创建数据库后,无法更改此属性的值。 | 
| properties.keys | 
				
		<string, 
		Database | 要使用的用户分配标识的资源 ID | 
| properties.licenseType | 要申请此数据库的许可证类型。 如果需要许可证, | |
| properties.longTermRetentionBackupResourceId | string (arm-id) | 与此数据库的创建作关联的长期保留备份的资源标识符。 | 
| properties.maintenanceConfigurationId | string | 分配给数据库的维护配置 ID。 此配置定义维护更新的发生时间。 | 
| properties.manualCutover | boolean | 在“更新数据库”作到“超大规模”层期间,是否需要执行客户控制的手动直接转换。 仅当将数据库从业务关键/常规用途/高级/标准层缩放到“超大规模”层时,此属性才适用。 指定 manualCutover 时,缩放作将等待用户输入触发“超大规模”数据库的直接转换。 若要触发直接转换,请在缩放作处于等待状态时提供“performCutover”参数。 | 
| properties.maxSizeBytes | integer (int64) | 以字节表示的数据库的最大大小。 | 
| properties.minCapacity | number (double) | 数据库始终分配的最小容量(如果未暂停) | 
| properties.performCutover | boolean | 在缩放作正在进行期间触发客户控制的手动直接转换。 此属性参数仅适用于随“manualCutover”参数一起启动的缩放作。 仅当正在将数据库从业务关键/常规用途/高级/标准层缩放到“超大规模”层时,此属性才适用。 指定 performCutover 时,缩放作将触发直接转换并执行超大规模数据库的角色更改。 | 
| properties.preferredEnclaveType | 在数据库(即默认或 VBS enclave)上请求的 enclave 类型。 | |
| properties.readScale | 只读路由的状态。 如果启用,将应用程序意向设置为只读的连接在其连接字符串中可能会路由到同一区域中的只读次要副本。 不适用于弹性池中的“超大规模”数据库。 | |
| properties.recoverableDatabaseId | string (arm-id) | 与此数据库的创建作关联的可恢复数据库的资源标识符。 | 
| properties.recoveryServicesRecoveryPointId | string (arm-id) | 与此数据库的创建作关联的恢复点的资源标识符。 | 
| properties.requestedBackupStorageRedundancy | 用于存储此数据库的备份的存储帐户类型。 | |
| properties.restorableDroppedDatabaseId | string (arm-id) | 与此数据库的创建作关联的可还原已删除数据库的资源标识符。 | 
| properties.restorePointInTime | string (date-time) | 指定将还原以创建新数据库的源数据库的时间点(ISO8601格式)。 | 
| properties.sampleName | 创建此数据库时要应用的示例架构的名称。 | |
| properties.secondaryType | 数据库的辅助类型(如果是辅助数据库)。 有效值为 Geo、Named 和 Standby。 | |
| properties.sourceDatabaseDeletionDate | string (date-time) | 指定删除数据库的时间。 | 
| properties.sourceDatabaseId | string (arm-id) | 与此数据库的创建作关联的源数据库的资源标识符。 | 
| properties.useFreeLimit | boolean | 数据库是否使用免费的每月限制。 在订阅中的一个数据库上允许。 | 
| properties.zoneRedundant | boolean | 此数据库是否为区域冗余,这意味着此数据库的副本将分布在多个可用性区域。 | 
| sku | SKU 的名称和层。 | |
| tags | object | 资源标记。 | 
响应
| 名称 | 类型 | 说明 | 
|---|---|---|
| 200 OK | 已成功更新数据库。 | |
| 202 Accepted | 正在更新数据库。 标头 Location: string | |
| Other Status Codes | 错误响应: *** 
 | 
示例
Assigns maintenance window to a database.
示例请求
PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2023-08-01
{
  "sku": {
    "name": "BC_Gen5_4"
  },
  "properties": {
    "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"
  }
}
示例响应
{
  "sku": {
    "name": "BC_Gen5",
    "tier": "BusinessCritical",
    "capacity": 4
  },
  "kind": "v12.0,user,vcore",
  "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": "BC_Gen5_2",
    "requestedServiceObjectiveName": "BC_Gen5_2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "licenseType": "LicenseIncluded",
    "maxLogSizeBytes": 104857600,
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "readScale": "Enabled",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "currentSku": {
      "name": "BC_Gen5",
      "tier": "BusinessCritical",
      "capacity": 4
    },
    "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"
  },
  "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"
}Location: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/locations/southeastasia/databaseOperationResults/11111111-1111-1111-1111-111111111111Patch a database with database-level customer managed keys.
示例请求
PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2023-08-01
{
  "identity": {
    "userAssignedIdentities": {
      "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umi": {},
      "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umiToDelete": null
    },
    "type": "UserAssigned"
  },
  "sku": {
    "name": "S0",
    "tier": "Standard"
  },
  "properties": {
    "keys": {
      "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion": {},
      "https://your-key-vault-name.vault.azure.net/yourKey2/yourKey2VersionToDelete": null
    },
    "encryptionProtector": "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion"
  }
}
示例响应
{
  "sku": {
    "name": "BC_Gen4",
    "tier": "BusinessCritical",
    "capacity": 4
  },
  "kind": "v12.0,user,vcore",
  "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": "BC_Gen4_2",
    "requestedServiceObjectiveName": "BC_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "licenseType": "LicenseIncluded",
    "maxLogSizeBytes": 104857600,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "readScale": "Enabled",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "currentSku": {
      "name": "BC_Gen4",
      "tier": "BusinessCritical",
      "capacity": 4
    },
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Local",
    "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"
}Location: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/locations/southeastasia/databaseOperationResults/11111111-1111-1111-1111-111111111111Resets maintenance window of a database to default.
示例请求
PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2023-08-01
{
  "sku": {
    "name": "BC_Gen5_4"
  },
  "properties": {
    "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"
  }
}
示例响应
{
  "sku": {
    "name": "BC_Gen5",
    "tier": "BusinessCritical",
    "capacity": 4
  },
  "kind": "v12.0,user,vcore",
  "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": "BC_Gen5_4",
    "requestedServiceObjectiveName": "BC_Gen5_4",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "licenseType": "LicenseIncluded",
    "maxLogSizeBytes": 104857600,
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "readScale": "Enabled",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "currentSku": {
      "name": "BC_Gen5",
      "tier": "BusinessCritical",
      "capacity": 4
    }
  },
  "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"
}Location: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/locations/southeastasia/databaseOperationResults/11111111-1111-1111-1111-111111111111Updates a database with Default enclave type.
示例请求
示例响应
{
  "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,
    "preferredEnclaveType": "Default"
  },
  "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"
}Location: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/locations/southeastasia/databaseOperationResults/11111111-1111-1111-1111-111111111111Updates a database with VBS enclave type.
示例请求
示例响应
{
  "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,
    "preferredEnclaveType": "VBS"
  },
  "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"
}Location: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/locations/southeastasia/databaseOperationResults/11111111-1111-1111-1111-111111111111Updates a database.
示例请求
PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2023-08-01
{
  "sku": {
    "name": "BC_Gen4_4"
  },
  "properties": {
    "maxSizeBytes": 1073741824,
    "licenseType": "LicenseIncluded"
  }
}
示例响应
{
  "sku": {
    "name": "BC_Gen4",
    "tier": "BusinessCritical",
    "capacity": 4
  },
  "kind": "v12.0,user,vcore",
  "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": "BC_Gen4_2",
    "requestedServiceObjectiveName": "BC_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "licenseType": "LicenseIncluded",
    "maxLogSizeBytes": 104857600,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "readScale": "Enabled",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "currentSku": {
      "name": "BC_Gen4",
      "tier": "BusinessCritical",
      "capacity": 4
    },
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Local",
    "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"
}Location: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/locations/southeastasia/databaseOperationResults/11111111-1111-1111-1111-111111111111定义
| 名称 | 说明 | 
|---|---|
| Always | 在数据库(即默认或 VBS enclave)上请求的 enclave 类型。 | 
| Availability | 指定数据库固定到的可用性区域。 | 
| Backup | 用于存储此数据库的备份的存储帐户类型。 | 
| Catalog | 元数据目录的排序规则。 | 
| Create | 指定数据库创建模式。 默认值:常规数据库创建。 复制:将数据库创建为现有数据库的副本。 sourceDatabaseId 必须指定为源数据库的资源 ID。 辅助数据库:将数据库创建为现有数据库的次要副本。 sourceDatabaseId 必须指定为现有主数据库的资源 ID。 PointInTimeRestore:通过还原现有数据库的时间点备份来创建数据库。 sourceDatabaseId 必须指定为现有数据库的资源 ID,并且必须指定 restorePointInTime。 恢复:通过还原异地复制的备份来创建数据库。 sourceDatabaseId 必须指定为可恢复的数据库资源 ID 才能还原。 还原:通过还原已删除数据库的备份来创建数据库。 必须指定 sourceDatabaseId。 如果 sourceDatabaseId 是数据库的原始资源 ID,则必须指定 sourceDatabaseDeletionDate。 否则,sourceDatabaseId 必须是可还原删除的数据库资源 ID,并且将忽略 sourceDatabaseDeletionDate。 还可以指定 restorePointInTime,以便从以前的时间点还原。 RestoreLongTermRetentionBackup:通过从长期保留保管库还原来创建数据库。 recoveryServicesRecoveryPointResourceId 必须指定为恢复点资源 ID。 DataWarehouse 版本不支持 Copy、Secondary 和 RestoreLongTermRetentionBackup。 | 
| Database | 数据库资源。 | 
| Database | 资源的 Azure Active Directory 标识配置。 | 
| Database | 标识类型 | 
| Database | 用于静态加密的数据库级密钥。 | 
| Database | 数据库密钥类型。 仅支持的值是“AzureKeyVault”。 | 
| Database | 要申请此数据库的许可证类型。 如果需要许可证, | 
| Database | 只读路由的状态。 如果启用,将应用程序意向设置为只读的连接在其连接字符串中可能会路由到同一区域中的只读次要副本。 不适用于弹性池中的“超大规模”数据库。 | 
| Database | 数据库的状态。 | 
| Database | 数据库更新资源。 | 
| Database | 资源的 Azure Active Directory 标识配置。 | 
| Error | 资源管理错误附加信息。 | 
| Error | 错误详细信息。 | 
| Error | 错误响应 | 
| Free | 指定免费数据库使用每月免费限制时的行为。 AutoPause:当剩余月份的可用限制用尽时,数据库将自动暂停。 BillForUsage:在耗尽免费限制后,数据库将继续联机,并且将收取任何超额费用。 | 
| Sample | 创建此数据库时要应用的示例架构的名称。 | 
| Secondary | 数据库的辅助类型(如果是辅助数据库)。 有效值为 Geo、Named 和 Standby。 | 
| Sku | ARM 资源 SKU。 | 
AlwaysEncryptedEnclaveType   
			
			在数据库(即默认或 VBS enclave)上请求的 enclave 类型。
| 值 | 说明 | 
|---|---|
| Default | |
| VBS | 
AvailabilityZoneType  
			
			指定数据库固定到的可用性区域。
| 值 | 说明 | 
|---|---|
| NoPreference | |
| 1 | |
| 2 | |
| 3 | 
BackupStorageRedundancy  
			
			用于存储此数据库的备份的存储帐户类型。
| 值 | 说明 | 
|---|---|
| Geo | |
| Local | |
| Zone | |
| GeoZone | 
CatalogCollationType  
			
			元数据目录的排序规则。
| 值 | 说明 | 
|---|---|
| DATABASE_DEFAULT | |
| SQL_Latin1_General_CP1_CI_AS | 
CreateMode 
			
			指定数据库创建模式。
默认值:常规数据库创建。
复制:将数据库创建为现有数据库的副本。 sourceDatabaseId 必须指定为源数据库的资源 ID。
辅助数据库:将数据库创建为现有数据库的次要副本。 sourceDatabaseId 必须指定为现有主数据库的资源 ID。
PointInTimeRestore:通过还原现有数据库的时间点备份来创建数据库。 sourceDatabaseId 必须指定为现有数据库的资源 ID,并且必须指定 restorePointInTime。
恢复:通过还原异地复制的备份来创建数据库。 sourceDatabaseId 必须指定为可恢复的数据库资源 ID 才能还原。
还原:通过还原已删除数据库的备份来创建数据库。 必须指定 sourceDatabaseId。 如果 sourceDatabaseId 是数据库的原始资源 ID,则必须指定 sourceDatabaseDeletionDate。 否则,sourceDatabaseId 必须是可还原删除的数据库资源 ID,并且将忽略 sourceDatabaseDeletionDate。 还可以指定 restorePointInTime,以便从以前的时间点还原。
RestoreLongTermRetentionBackup:通过从长期保留保管库还原来创建数据库。 recoveryServicesRecoveryPointResourceId 必须指定为恢复点资源 ID。
DataWarehouse 版本不支持 Copy、Secondary 和 RestoreLongTermRetentionBackup。
| 值 | 说明 | 
|---|---|
| Default | |
| Copy | |
| Secondary | |
| PointInTimeRestore | |
| Restore | |
| Recovery | |
| RestoreExternalBackup | |
| RestoreExternalBackupSecondary | |
| RestoreLongTermRetentionBackup | |
| OnlineSecondary | 
Database
数据库资源。
| 名称 | 类型 | 说明 | 
|---|---|---|
| id | string | 资源 ID。 | 
| identity | 数据库的 Azure Active Directory 标识。 | |
| kind | string | 数据库类型。 这是用于 Azure 门户体验的元数据。 | 
| location | string | 资源位置。 | 
| managedBy | string | 管理数据库的资源。 | 
| name | string | 资源名称。 | 
| properties.autoPauseDelay | integer (int32) | 数据库自动暂停的时间(以分钟为单位)。 -1 值表示禁用自动暂停 | 
| properties.availabilityZone | 指定数据库固定到的可用性区域。 | |
| properties.catalogCollation | 元数据目录的排序规则。 | |
| properties.collation | string | 数据库的排序规则。 | 
| properties.createMode | 指定数据库创建模式。 默认值:常规数据库创建。 复制:将数据库创建为现有数据库的副本。 sourceDatabaseId 必须指定为源数据库的资源 ID。 辅助数据库:将数据库创建为现有数据库的次要副本。 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 (date-time) | 数据库的创建日期(ISO8601格式)。 | 
| properties.currentBackupStorageRedundancy | 用于存储此数据库的备份的存储帐户类型。 | |
| properties.currentServiceObjectiveName | string | 数据库的当前服务级别目标名称。 | 
| properties.currentSku | SKU 的名称和层。 | |
| properties.databaseId | string (uuid) | 数据库的 ID。 | 
| properties.defaultSecondaryLocation | string | 此数据库的默认次要区域。 | 
| properties.earliestRestoreDate | string (date-time) | 这会记录此数据库的最早开始日期和时间(ISO8601格式)。 | 
| properties.elasticPoolId | string (arm-id) | 包含此数据库的弹性池的资源标识符。 | 
| properties.encryptionProtector | string | 如果数据库配置了每个数据库客户管理的密钥,则数据库的 Azure 密钥保管库 URI。 | 
| properties.encryptionProtectorAutoRotation | boolean | 用于启用或禁用数据库加密保护程序 AKV 密钥自动轮换的标志。 | 
| properties.failoverGroupId | string | 此数据库所属的故障转移组资源标识符。 | 
| properties.federatedClientId | string (uuid) | 用于每个数据库 CMK 方案的跨租户的客户端 ID | 
| properties.freeLimitExhaustionBehavior | 指定免费数据库使用每月免费限制时的行为。 AutoPause:当剩余月份的可用限制用尽时,数据库将自动暂停。 BillForUsage:在耗尽免费限制后,数据库将继续联机,并且将收取任何超额费用。 | |
| properties.highAvailabilityReplicaCount | integer (int32) | 与用于提供高可用性的业务关键版、高级版或超大规模版数据库关联的次要副本数。 不适用于弹性池中的“超大规模”数据库。 | 
| properties.isInfraEncryptionEnabled | boolean | 为此数据库启用了基础结构加密。 | 
| properties.isLedgerOn | boolean | 此数据库是否为账本数据库,这意味着数据库中的所有表都是账本表。 注意:创建数据库后,无法更改此属性的值。 | 
| properties.keys | 
				
		<string, 
		Database | 要使用的用户分配标识的资源 ID | 
| properties.licenseType | 要申请此数据库的许可证类型。 如果需要许可证, | |
| properties.longTermRetentionBackupResourceId | string (arm-id) | 与此数据库的创建作关联的长期保留备份的资源标识符。 | 
| properties.maintenanceConfigurationId | string | 分配给数据库的维护配置 ID。 此配置定义维护更新的发生时间。 | 
| properties.manualCutover | boolean | 在“更新数据库”作到“超大规模”层期间,是否需要执行客户控制的手动直接转换。 仅当将数据库从业务关键/常规用途/高级/标准层缩放到“超大规模”层时,此属性才适用。 指定 manualCutover 时,缩放作将等待用户输入触发“超大规模”数据库的直接转换。 若要触发直接转换,请在缩放作处于等待状态时提供“performCutover”参数。 | 
| properties.maxLogSizeBytes | integer (int64) | 此数据库的最大日志大小。 | 
| properties.maxSizeBytes | integer (int64) | 以字节表示的数据库的最大大小。 | 
| properties.minCapacity | number (double) | 数据库始终分配的最小容量(如果未暂停) | 
| properties.pausedDate | string (date-time) | 由用户配置或作(ISO8601格式)暂停数据库的日期。 如果数据库准备就绪,则为 Null。 | 
| properties.performCutover | boolean | 在缩放作正在进行期间触发客户控制的手动直接转换。 此属性参数仅适用于随“manualCutover”参数一起启动的缩放作。 仅当正在将数据库从业务关键/常规用途/高级/标准层缩放到“超大规模”层时,此属性才适用。 指定 performCutover 时,缩放作将触发直接转换并执行超大规模数据库的角色更改。 | 
| properties.preferredEnclaveType | 在数据库(即默认或 VBS enclave)上请求的 enclave 类型。 | |
| properties.readScale | 只读路由的状态。 如果启用,将应用程序意向设置为只读的连接在其连接字符串中可能会路由到同一区域中的只读次要副本。 不适用于弹性池中的“超大规模”数据库。 | |
| properties.recoverableDatabaseId | string (arm-id) | 与此数据库的创建作关联的可恢复数据库的资源标识符。 | 
| properties.recoveryServicesRecoveryPointId | string (arm-id) | 与此数据库的创建作关联的恢复点的资源标识符。 | 
| properties.requestedBackupStorageRedundancy | 用于存储此数据库的备份的存储帐户类型。 | |
| properties.requestedServiceObjectiveName | string | 请求的数据库服务级别目标名称。 | 
| properties.restorableDroppedDatabaseId | string (arm-id) | 与此数据库的创建作关联的可还原已删除数据库的资源标识符。 | 
| properties.restorePointInTime | string (date-time) | 指定将还原以创建新数据库的源数据库的时间点(ISO8601格式)。 | 
| properties.resumedDate | string (date-time) | 用户作或数据库登录恢复数据库的日期(ISO8601格式)。 如果暂停数据库,则为 Null。 | 
| properties.sampleName | 创建此数据库时要应用的示例架构的名称。 | |
| properties.secondaryType | 数据库的辅助类型(如果是辅助数据库)。 有效值为 Geo、Named 和 Standby。 | |
| properties.sourceDatabaseDeletionDate | string (date-time) | 指定删除数据库的时间。 | 
| properties.sourceDatabaseId | string (arm-id) | 与此数据库的创建作关联的源数据库的资源标识符。 | 
| properties.sourceResourceId | string (arm-id) | 与此数据库的创建作关联的源的资源标识符。 仅 DataWarehouse 版本支持此属性,并允许跨订阅还原。 指定 sourceResourceId 时,sourceDatabaseId、recoverableDatabaseId、restoreableDroppedDatabaseId 和 sourceDatabaseDeletionDate 不得指定,CreateMode 必须是 PointInTimeRestore、Restore 或 Recover。 createMode 为 PointInTimeRestore 时,sourceResourceId 必须是现有数据库或现有 sql 池的资源 ID,并且必须指定 restorePointInTime。 当 createMode 为 Restore 时,sourceResourceId 必须是可还原的已删除数据库或可还原的已删除 sql 池的资源 ID。 CreateMode 为 Recover 时,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 | 数据库的状态。 | |
| properties.useFreeLimit | boolean | 数据库是否使用免费的每月限制。 在订阅中的一个数据库上允许。 | 
| properties.zoneRedundant | boolean | 此数据库是否为区域冗余,这意味着此数据库的副本将分布在多个可用性区域。 | 
| sku | 数据库 SKU。 SKU 列表可能因区域和支持产品/服务而异。 若要确定 Azure 区域中订阅可用的 SKU(包括 SKU 名称、层/版本、系列和容量),请使用   | |
| tags | object | 资源标记。 | 
| type | string | 资源类型。 | 
DatabaseIdentity 
			
			资源的 Azure Active Directory 标识配置。
| 名称 | 类型 | 说明 | 
|---|---|---|
| tenantId | string (uuid) | Azure Active Directory 租户 ID。 | 
| type | 标识类型 | |
| userAssignedIdentities | 
				
		<string, 
		Database | 要使用的用户分配标识的资源 ID | 
DatabaseIdentityType  
			
			标识类型
| 值 | 说明 | 
|---|---|
| None | |
| UserAssigned | 
DatabaseKey 
			
			用于静态加密的数据库级密钥。
| 名称 | 类型 | 说明 | 
|---|---|---|
| creationDate | string (date-time) | 数据库密钥创建日期。 | 
| subregion | string | 服务器密钥的子区域。 | 
| thumbprint | string | 数据库密钥的指纹。 | 
| type | 数据库密钥类型。 仅支持的值是“AzureKeyVault”。 | 
DatabaseKeyType  
			
			数据库密钥类型。 仅支持的值是“AzureKeyVault”。
| 值 | 说明 | 
|---|---|
| AzureKeyVault | 
DatabaseLicenseType  
			
			要申请此数据库的许可证类型。 如果需要许可证,LicenseIncluded,或者 BasePrice 拥有许可证并且有资格获得 Azure 混合权益。
| 值 | 说明 | 
|---|---|
| LicenseIncluded | |
| BasePrice | 
DatabaseReadScale  
			
			只读路由的状态。 如果启用,将应用程序意向设置为只读的连接在其连接字符串中可能会路由到同一区域中的只读次要副本。 不适用于弹性池中的“超大规模”数据库。
| 值 | 说明 | 
|---|---|
| Enabled | |
| Disabled | 
DatabaseStatus 
			
			数据库的状态。
| 值 | 说明 | 
|---|---|
| Online | |
| Restoring | |
| RecoveryPending | |
| Recovering | |
| Suspect | |
| Offline | |
| Standby | |
| Shutdown | |
| EmergencyMode | |
| AutoClosed | |
| Copying | |
| Creating | |
| Inaccessible | |
| OfflineSecondary | |
| Pausing | |
| Paused | |
| Resuming | |
| Scaling | |
| OfflineChangingDwPerformanceTiers | |
| OnlineChangingDwPerformanceTiers | |
| Disabled | |
| Stopping | |
| Stopped | |
| Starting | 
DatabaseUpdate 
			
			数据库更新资源。
| 名称 | 类型 | 说明 | 
|---|---|---|
| identity | 数据库标识 | |
| properties.autoPauseDelay | integer (int32) | 数据库自动暂停的时间(以分钟为单位)。 -1 值表示禁用自动暂停 | 
| properties.catalogCollation | 元数据目录的排序规则。 | |
| properties.collation | string | 数据库的排序规则。 | 
| properties.createMode | 指定数据库创建模式。 默认值:常规数据库创建。 复制:将数据库创建为现有数据库的副本。 sourceDatabaseId 必须指定为源数据库的资源 ID。 辅助数据库:将数据库创建为现有数据库的次要副本。 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 (date-time) | 数据库的创建日期(ISO8601格式)。 | 
| properties.currentBackupStorageRedundancy | 用于存储此数据库的备份的存储帐户类型。 | |
| properties.currentServiceObjectiveName | string | 数据库的当前服务级别目标名称。 | 
| properties.currentSku | SKU 的名称和层。 | |
| properties.databaseId | string (uuid) | 数据库的 ID。 | 
| properties.defaultSecondaryLocation | string | 此数据库的默认次要区域。 | 
| properties.earliestRestoreDate | string (date-time) | 这会记录此数据库的最早开始日期和时间(ISO8601格式)。 | 
| properties.elasticPoolId | string (arm-id) | 包含此数据库的弹性池的资源标识符。 | 
| properties.encryptionProtector | string | 如果数据库配置了每个数据库客户管理的密钥,则数据库的 Azure 密钥保管库 URI。 | 
| properties.encryptionProtectorAutoRotation | boolean | 用于启用或禁用数据库加密保护程序 AKV 密钥自动轮换的标志。 | 
| properties.failoverGroupId | string | 此数据库所属的故障转移组资源标识符。 | 
| properties.federatedClientId | string (uuid) | 用于每个数据库 CMK 方案的跨租户的客户端 ID | 
| properties.freeLimitExhaustionBehavior | 指定免费数据库使用每月免费限制时的行为。 AutoPause:当剩余月份的可用限制用尽时,数据库将自动暂停。 BillForUsage:在耗尽免费限制后,数据库将继续联机,并且将收取任何超额费用。 | |
| properties.highAvailabilityReplicaCount | integer (int32) | 与用于提供高可用性的业务关键版、高级版或超大规模版数据库关联的次要副本数。 不适用于弹性池中的“超大规模”数据库。 | 
| properties.isInfraEncryptionEnabled | boolean | 为此数据库启用了基础结构加密。 | 
| properties.isLedgerOn | boolean | 此数据库是否为账本数据库,这意味着数据库中的所有表都是账本表。 注意:创建数据库后,无法更改此属性的值。 | 
| properties.keys | 
				
		<string, 
		Database | 要使用的用户分配标识的资源 ID | 
| properties.licenseType | 要申请此数据库的许可证类型。 如果需要许可证, | |
| properties.longTermRetentionBackupResourceId | string (arm-id) | 与此数据库的创建作关联的长期保留备份的资源标识符。 | 
| properties.maintenanceConfigurationId | string | 分配给数据库的维护配置 ID。 此配置定义维护更新的发生时间。 | 
| properties.manualCutover | boolean | 在“更新数据库”作到“超大规模”层期间,是否需要执行客户控制的手动直接转换。 仅当将数据库从业务关键/常规用途/高级/标准层缩放到“超大规模”层时,此属性才适用。 指定 manualCutover 时,缩放作将等待用户输入触发“超大规模”数据库的直接转换。 若要触发直接转换,请在缩放作处于等待状态时提供“performCutover”参数。 | 
| properties.maxLogSizeBytes | integer (int64) | 此数据库的最大日志大小。 | 
| properties.maxSizeBytes | integer (int64) | 以字节表示的数据库的最大大小。 | 
| properties.minCapacity | number (double) | 数据库始终分配的最小容量(如果未暂停) | 
| properties.pausedDate | string (date-time) | 由用户配置或作(ISO8601格式)暂停数据库的日期。 如果数据库准备就绪,则为 Null。 | 
| properties.performCutover | boolean | 在缩放作正在进行期间触发客户控制的手动直接转换。 此属性参数仅适用于随“manualCutover”参数一起启动的缩放作。 仅当正在将数据库从业务关键/常规用途/高级/标准层缩放到“超大规模”层时,此属性才适用。 指定 performCutover 时,缩放作将触发直接转换并执行超大规模数据库的角色更改。 | 
| properties.preferredEnclaveType | 在数据库(即默认或 VBS enclave)上请求的 enclave 类型。 | |
| properties.readScale | 只读路由的状态。 如果启用,将应用程序意向设置为只读的连接在其连接字符串中可能会路由到同一区域中的只读次要副本。 不适用于弹性池中的“超大规模”数据库。 | |
| properties.recoverableDatabaseId | string (arm-id) | 与此数据库的创建作关联的可恢复数据库的资源标识符。 | 
| properties.recoveryServicesRecoveryPointId | string (arm-id) | 与此数据库的创建作关联的恢复点的资源标识符。 | 
| properties.requestedBackupStorageRedundancy | 用于存储此数据库的备份的存储帐户类型。 | |
| properties.requestedServiceObjectiveName | string | 请求的数据库服务级别目标名称。 | 
| properties.restorableDroppedDatabaseId | string (arm-id) | 与此数据库的创建作关联的可还原已删除数据库的资源标识符。 | 
| properties.restorePointInTime | string (date-time) | 指定将还原以创建新数据库的源数据库的时间点(ISO8601格式)。 | 
| properties.resumedDate | string (date-time) | 用户作或数据库登录恢复数据库的日期(ISO8601格式)。 如果暂停数据库,则为 Null。 | 
| properties.sampleName | 创建此数据库时要应用的示例架构的名称。 | |
| properties.secondaryType | 数据库的辅助类型(如果是辅助数据库)。 有效值为 Geo、Named 和 Standby。 | |
| properties.sourceDatabaseDeletionDate | string (date-time) | 指定删除数据库的时间。 | 
| properties.sourceDatabaseId | string (arm-id) | 与此数据库的创建作关联的源数据库的资源标识符。 | 
| properties.status | 数据库的状态。 | |
| properties.useFreeLimit | boolean | 数据库是否使用免费的每月限制。 在订阅中的一个数据库上允许。 | 
| properties.zoneRedundant | boolean | 此数据库是否为区域冗余,这意味着此数据库的副本将分布在多个可用性区域。 | 
| sku | SKU 的名称和层。 | |
| tags | object | 资源标记。 | 
DatabaseUserIdentity  
			
			资源的 Azure Active Directory 标识配置。
| 名称 | 类型 | 说明 | 
|---|---|---|
| clientId | string (uuid) | Azure Active Directory 客户端 ID。 | 
| principalId | string (uuid) | Azure Active Directory 主体 ID。 | 
ErrorAdditionalInfo  
			
			资源管理错误附加信息。
| 名称 | 类型 | 说明 | 
|---|---|---|
| info | object | 其他信息。 | 
| type | string | 其他信息类型。 | 
ErrorDetail 
			
			错误详细信息。
| 名称 | 类型 | 说明 | 
|---|---|---|
| additionalInfo | 错误附加信息。 | |
| code | string | 错误代码。 | 
| details | 错误详细信息。 | |
| message | string | 错误消息。 | 
| target | string | 错误目标。 | 
ErrorResponse 
			
			错误响应
| 名称 | 类型 | 说明 | 
|---|---|---|
| error | 错误对象。 | 
FreeLimitExhaustionBehavior   
			
			指定免费数据库使用每月免费限制时的行为。
AutoPause:当剩余月份的可用限制用尽时,数据库将自动暂停。
BillForUsage:在耗尽免费限制后,数据库将继续联机,并且将收取任何超额费用。
| 值 | 说明 | 
|---|---|
| AutoPause | |
| BillOverUsage | 
SampleName 
			
			创建此数据库时要应用的示例架构的名称。
| 值 | 说明 | 
|---|---|
| AdventureWorksLT | |
| WideWorldImportersStd | |
| WideWorldImportersFull | 
SecondaryType 
			
			数据库的辅助类型(如果是辅助数据库)。 有效值为 Geo、Named 和 Standby。
| 值 | 说明 | 
|---|---|
| Geo | |
| Named | |
| Standby | 
Sku
ARM 资源 SKU。
| 名称 | 类型 | 说明 | 
|---|---|---|
| capacity | integer (int32) | 特定 SKU 的容量。 | 
| family | string | 如果服务具有不同代的硬件(对于同一 SKU,则可以在此处捕获)。 | 
| name | string | SKU 的名称,通常为字母 + 数字代码,例如 P3。 | 
| size | string | 特定 SKU 的大小 | 
| tier | string | 特定 SKU 的层或版本,例如基本 SKU、高级版。 |