Author | Andreas Jordan, @JordanOrdix |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Update-DbaMaintenanceSolution on GitHub.
Want to see the Bill Of Health for this command? Check out Update-DbaMaintenanceSolution.
Download and Update SQL Server Maintenance Solution created by Ola Hallengren (https://ola.hallengren.com)
This script will download and update the latest version of SQL Server Maintenance Solution created by Ola Hallengren.
Only the stored procedure will be updated. All tables and jobs will stay untouched.
So this can only be used until a new version of the procedures need a new version of the tables or jobs.
In this case you have to completely reinstall the SQL Server Maintenance Solution with Install-DbaMaintenanceSolution.
Update-DbaMaintenanceSolution
[-SqlInstance] <DbaInstanceParameter[]>
[[-SqlCredential] <PSCredential>]
[[-Database] <String>]
[[-Solution] <String[]>]
[[-LocalFile] <String>]
[-Force]
[-EnableException]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
PS C:\> Update-DbaMaintenanceSolution -SqlInstance RES14224 -Database DBA
Updates Ola Hallengren's Solution objects on RES14224 in the DBA database.
The target SQL Server instance onto which the Maintenance Solution will be updated.
Alias | |
Required | True |
Pipeline | true (ByValue) |
Default Value |
Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.
Alias | |
Required | False |
Pipeline | false |
Default Value |
The database where Ola Hallengren's solution is currently installed. Defaults to master.
Alias | |
Required | False |
Pipeline | false |
Default Value | master |
Specifies which portion of the Maintenance solution to update. Valid values are All (full solution), Backup, IntegrityCheck and IndexOptimize.
Defaults to All, but only existing procedures will be replaced.
Alias | |
Required | False |
Pipeline | false |
Default Value | All |
Accepted Values | All,Backup,IntegrityCheck,IndexOptimize,CommandExecute |
Specifies the path to a local file to install Ola's solution from. This should be the zip file as distributed by the maintainers.
If this parameter is not specified, the latest version will be downloaded from https://github.com/olahallengren/sql-server-maintenance-solution
Alias | |
Required | False |
Pipeline | false |
Default Value |
If this switch is enabled, the Ola's solution will be downloaded from the internet even if previously cached.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run.
Alias | wi |
Required | False |
Pipeline | false |
Default Value |
If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.
Alias | cf |
Required | False |
Pipeline | false |
Default Value |