database_advisors
Creates, updates, deletes, gets or lists a database_advisors resource.
Overview
| Name | database_advisors |
| Type | Resource |
| Id | azure.sql.database_advisors |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_database
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
advisorStatus | string | Gets the status of availability of this advisor to customers. Possible values are 'GA', 'PublicPreview', 'LimitedPublicPreview' and 'PrivatePreview'. Known values are: "GA", "PublicPreview", "LimitedPublicPreview", and "PrivatePreview". (GA, PublicPreview, LimitedPublicPreview, PrivatePreview) |
autoExecuteStatus | string | Gets the auto-execute status (whether to let the system execute the recommendations) of this advisor. Possible values are 'Enabled' and 'Disabled'. Required. Known values are: "Enabled", "Disabled", and "Default". (Enabled, Disabled, Default) |
autoExecuteStatusInheritedFrom | string | Gets the resource from which current value of auto-execute status is inherited. Auto-execute status can be set on (and inherited from) different levels in the resource hierarchy. Possible values are 'Subscription', 'Server', 'ElasticPool', 'Database' and 'Default' (when status is not explicitly set on any level). Known values are: "Default", "Subscription", "Server", "ElasticPool", and "Database". (Default, Subscription, Server, ElasticPool, Database) |
kind | string | Resource kind. |
lastChecked | string (date-time) | Gets the time when the current resource was analyzed for recommendations by this advisor. |
location | string | Resource location. |
recommendationsStatus | string | Gets that status of recommendations for this advisor and reason for not having any recommendations. Possible values include, but are not limited to, 'Ok' (Recommendations available),LowActivity (not enough workload to analyze), 'DbSeemsTuned' (Database is doing well), etc. |
recommendedActions | array | Gets the recommended actions for this advisor. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
advisorStatus | string | Gets the status of availability of this advisor to customers. Possible values are 'GA', 'PublicPreview', 'LimitedPublicPreview' and 'PrivatePreview'. Known values are: "GA", "PublicPreview", "LimitedPublicPreview", and "PrivatePreview". (GA, PublicPreview, LimitedPublicPreview, PrivatePreview) |
autoExecuteStatus | string | Gets the auto-execute status (whether to let the system execute the recommendations) of this advisor. Possible values are 'Enabled' and 'Disabled'. Required. Known values are: "Enabled", "Disabled", and "Default". (Enabled, Disabled, Default) |
autoExecuteStatusInheritedFrom | string | Gets the resource from which current value of auto-execute status is inherited. Auto-execute status can be set on (and inherited from) different levels in the resource hierarchy. Possible values are 'Subscription', 'Server', 'ElasticPool', 'Database' and 'Default' (when status is not explicitly set on any level). Known values are: "Default", "Subscription", "Server", "ElasticPool", and "Database". (Default, Subscription, Server, ElasticPool, Database) |
kind | string | Resource kind. |
lastChecked | string (date-time) | Gets the time when the current resource was analyzed for recommendations by this advisor. |
location | string | Resource location. |
recommendationsStatus | string | Gets that status of recommendations for this advisor and reason for not having any recommendations. Possible values include, but are not limited to, 'Ok' (Recommendations available),LowActivity (not enough workload to analyze), 'DbSeemsTuned' (Database is doing well), etc. |
recommendedActions | array | Gets the recommended actions for this advisor. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, server_name, database_name, advisor_name, subscription_id | Gets a database advisor. | |
list_by_database | select | resource_group_name, server_name, database_name, subscription_id | $expand | Gets a list of database advisors. |
update | update | resource_group_name, server_name, database_name, advisor_name, subscription_id | Updates a database advisor. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
advisor_name | string | The name of the Database Advisor. Required. |
database_name | string | The name of the database. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
server_name | string | The name of the server. Required. |
subscription_id | string | |
$expand | string | The child resources to include in the response. Default value is None. |
SELECT examples
- get
- list_by_database
Gets a database advisor.
SELECT
id,
name,
advisorStatus,
autoExecuteStatus,
autoExecuteStatusInheritedFrom,
kind,
lastChecked,
location,
recommendationsStatus,
recommendedActions,
systemData,
type
FROM azure.sql.database_advisors
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND database_name = '{{ database_name }}' -- required
AND advisor_name = '{{ advisor_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets a list of database advisors.
SELECT
id,
name,
advisorStatus,
autoExecuteStatus,
autoExecuteStatusInheritedFrom,
kind,
lastChecked,
location,
recommendationsStatus,
recommendedActions,
systemData,
type
FROM azure.sql.database_advisors
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND database_name = '{{ database_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;
UPDATE examples
- update
Updates a database advisor.
UPDATE azure.sql.database_advisors
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND database_name = '{{ database_name }}' --required
AND advisor_name = '{{ advisor_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
kind,
location,
properties,
systemData,
type;