Set-AzureRmSqlDatabaseRecommendedActionState
Updates the state of an Azure SQL Database recommended action.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
Set-AzureRmSqlDatabaseRecommendedActionState
-RecommendedActionName <String>
-State <RecommendedActionState>
-ServerName <String>
-DatabaseName <String>
-AdvisorName <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-AzureRmSqlDatabaseRecommendedActionState cmdlet updates the state of an Azure SQL Database Recommended Action. This allows a recommended action to be applied, reverted or discarded based on the new state.
Examples
Example 1: Apply a recommended action state to pending
PS C:\>Set-AzureRmSqlDatabaseRecommendedActionState -ResourceGroupName "WIRunnersProd" -ServerName "wi-runner-australia-east" -DatabaseName "WIRunner" -AdvisorName "CreateIndex" -RecommendedActionName "IR_[test_schema]_[test_table_0.0361551]_6C7AE8CC9C87E7FD5893" -State Pending
DatabaseName : WIRunner
ResourceGroupName : WIRunnersProd
ServerName : wi-runner-australia-east
AdvisorName : CreateIndex
RecommendedActionName : IR_[test_schema]_[test_table_0.0361551]_6C7AE8CC9C87E7FD5893
Details : {[indexName, nci_wi_test_table_0.0361551_6C7AE8CC9C87E7FD5893], [indexType,
NONCLUSTERED], [schema, [test_schema]], [table, [test_table_0.0361551]]...}
ErrorDetails : Microsoft.Azure.Management.Sql.Models.RecommendedActionErrorInfo
EstimatedImpact : {ActionDuration, SpaceChange}
ExecuteActionDuration : PT1M
ExecuteActionInitiatedBy : User
ExecuteActionInitiatedTime : 4/21/2016 3:24:47 PM
ExecuteActionStartTime : 4/21/2016 3:24:47 PM
ImplementationDetails : Microsoft.Azure.Management.Sql.Models.RecommendedActionImplementationInfo
IsArchivedAction : False
IsExecutableAction : True
IsRevertableAction : True
LastRefresh : 4/21/2016 3:24:47 PM
LinkedObjects : {}
ObservedImpact : {CpuUtilization, LogicalReads, LogicalWrites, QueriesWithImprovedPerformance...}
RecommendationReason :
RevertActionDuration :
RevertActionInitiatedBy :
RevertActionInitiatedTime :
RevertActionStartTime :
Score : 2
State : Microsoft.Azure.Management.Sql.Models.RecommendedActionStateInfo
TimeSeries : {}
ValidSince : 4/21/2016 3:24:47 PM
This command updates the state of the recommended action named IR_[test_schema]_[test_table_0.0361551]_6C7AE8CC9C87E7FD5893 that belongs to the database named WIRunner to Pending.
Parameters
-AdvisorName
Specifies the name of the advisor for which this recommended action belongs to.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DatabaseName
Specifies the name of the database for which this cmdlet sets the recommended action state.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RecommendedActionName
Specifies the name of the recommended action for which state is being updated.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
Specifies the name of the resource group of the server that contains this database.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServerName
Specifies the name of the server the database is in.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-State
Specifies the new value to which this cmdlet updates the recommended action state. The acceptable values for this parameter are:
- Active
- Pending
- PendingRevert
- RevertCancelled
- Ignored
- Resolved
Type: | RecommendedActionState |
Accepted values: | Active, Pending, PendingRevert, RevertCancelled, Ignored, Resolved |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Outputs
AzureSqlDatabaseRecommendedActionModel
Notes
- Keywords: azure, azurerm, arm, resource, management, manager, sql, database, mssql, advisor, recommendedaction
Related Links
- Get-AzureRmSqlServerAdvisor
- Get-AzureRmSqlElasticPoolAdvisor
- Get-AzureRmSqlServerRecommendedAction
- Get-AzureRmSqlElasticPoolRecommendedAction
- Set-AzureRmSqlElasticPoolRecommendedActionState
- Set-AzureRmSqlElasticPoolAdvisorAutoExecuteStatus
- Set-AzureRmSqlElasticPoolRecommendedActionState
- Set-AzureRmSqlServerRecommendedActionState
- Set-AzureRmSqlElasticPoolAdvisorAutoExecuteStatus
- Set-AzureRmSqlServerAdvisorAutoExecuteStatus
- SQL Database Documentation