Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jpomfret committed Jan 6, 2025
1 parent 57f49da commit b7084f5
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions public/Install-DbaMaintenanceSolution.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ function Install-DbaMaintenanceSolution {
.PARAMETER ReplaceExisting
If this switch is enabled, objects already present in the target database will be dropped and recreated.
Note - The tables for `LogToTable` and `InstallParallel` will only be dropped if those options are also specified.
.PARAMETER LogToTable
If this switch is enabled, the Maintenance Solution will be configured to log commands to a table.
Expand Down Expand Up @@ -119,17 +121,33 @@ function Install-DbaMaintenanceSolution {
Installs Maintenance Solution to myserver in database. Adds Agent Jobs, and if any currently exist, they'll be replaced.
Since the `LogToTable` switch is enabled, the CommandLog table will be dropped and recreated also.
If the tables relating to `InstallParallel` are present, they will not be dropped.
.EXAMPLE
PS C:\> Install-DbaMaintenanceSolution -SqlInstance RES14224 -Database DBA -InstallJobs -BackupLocation "Z:\SQLBackup" -CleanupTime 72 -ReplaceExisting
PS C:\> $params = @{
>> SqlInstance = 'RES14224'
>> Database = 'DBA'
>> InstallJobs = $true
>> BackupLocation = 'Z:\SQLBackup'
>> CleanupTime = 72
>> ReplaceExisting = $true
>> }
PS C:\> Install-DbaMaintenanceSolution @params
This will drop and then recreate the Ola Hallengren's Solution objects
The cleanup script will drop and recreate:
- TABLE [dbo].[CommandLog]
- STORED PROCEDURE [dbo].[CommandExecute]
- STORED PROCEDURE [dbo].[DatabaseBackup]
- STORED PROCEDURE [dbo].[DatabaseIntegrityCheck]
- STORED PROCEDURE [dbo].[IndexOptimize]
The tables will not be dropped as the `LogToTable` and `InstallParallel` switches are not enabled.
- [dbo].[CommandLog]
- [dbo].[Queue]
- [dbo].[QueueDatabase]
The following SQL Agent jobs will be deleted:
- 'Output File Cleanup'
- 'IndexOptimize - USER_DATABASES'
Expand Down

0 comments on commit b7084f5

Please sign in to comment.