Database Automatic Tuning - Get
获取数据库的自动优化。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current?api-version=2023-08-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
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 版本。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
已成功检索数据库自动优化属性。 |
|
| Other Status Codes |
错误响应: ***
|
示例
Get a database's automatic tuning settings
示例请求
示例响应
{
"id": "/subscriptions/c3aa9078-0000-0000-0000-e36f151182d7/resourceGroups/default-sql-onebox/providers/Microsoft.Sql/servers/testsvr11/databases/db1/automaticTuning/current",
"name": "current",
"type": "Microsoft.Sql/servers/databases/automaticTuning",
"properties": {
"desiredState": "Auto",
"actualState": "Auto",
"options": {
"forceLastGoodPlan": {
"desiredState": "Default",
"actualState": "On",
"reasonCode": 2,
"reasonDesc": "AutoConfigured"
},
"createIndex": {
"desiredState": "Default",
"actualState": "On",
"reasonCode": 2,
"reasonDesc": "AutoConfigured"
},
"dropIndex": {
"desiredState": "Default",
"actualState": "Off",
"reasonCode": 2,
"reasonDesc": "AutoConfigured"
},
"maintainIndex": {
"desiredState": "Default",
"actualState": "Off",
"reasonCode": 2,
"reasonDesc": "AutoConfigured"
}
}
}
}
定义
| 名称 | 说明 |
|---|---|
|
Automatic |
如果需要和实际状态的原因说明不同。 |
|
Automatic |
自动优化所需状态。 |
|
Automatic |
自动优化选项实际状态。 |
|
Automatic |
自动优化选项所需状态。 |
|
Automatic |
单个顾问的自动优化属性。 |
|
Database |
数据库级自动优化。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
AutomaticTuningDisabledReason
如果需要和实际状态的原因说明不同。
| 值 | 说明 |
|---|---|
| Default | |
| Disabled | |
| AutoConfigured | |
| InheritedFromServer | |
| QueryStoreOff | |
| QueryStoreReadOnly | |
| NotSupported |
AutomaticTuningMode
自动优化所需状态。
| 值 | 说明 |
|---|---|
| Inherit | |
| Custom | |
| Auto | |
| Unspecified |
AutomaticTuningOptionModeActual
自动优化选项实际状态。
| 值 | 说明 |
|---|---|
| Off | |
| On |
AutomaticTuningOptionModeDesired
自动优化选项所需状态。
| 值 | 说明 |
|---|---|
| Off | |
| On | |
| Default |
AutomaticTuningOptions
单个顾问的自动优化属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| actualState |
自动优化选项实际状态。 |
|
| desiredState |
自动优化选项所需状态。 |
|
| reasonCode |
integer (int32) |
如果需要,原因代码和实际状态不同。 |
| reasonDesc |
如果需要和实际状态的原因说明不同。 |
DatabaseAutomaticTuning
数据库级自动优化。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源 ID。 |
| name |
string |
资源名称。 |
| properties.actualState |
自动优化实际状态。 |
|
| properties.desiredState |
自动优化所需状态。 |
|
| properties.options |
<string,
Automatic |
自动优化选项定义。 |
| type |
string |
资源类型。 |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |