@@ -31,6 +31,8 @@ function Install-DbaMaintenanceSolution {
31
31
. PARAMETER ReplaceExisting
32
32
If this switch is enabled, objects already present in the target database will be dropped and recreated.
33
33
34
+ Note - The tables for `LogToTable` and `InstallParallel` will only be dropped if those options are also specified.
35
+
34
36
. PARAMETER LogToTable
35
37
If this switch is enabled, the Maintenance Solution will be configured to log commands to a table.
36
38
@@ -119,17 +121,33 @@ function Install-DbaMaintenanceSolution {
119
121
120
122
Installs Maintenance Solution to myserver in database. Adds Agent Jobs, and if any currently exist, they'll be replaced.
121
123
124
+ Since the `LogToTable` switch is enabled, the CommandLog table will be dropped and recreated also.
125
+
126
+ If the tables relating to `InstallParallel` are present, they will not be dropped.
127
+
122
128
. EXAMPLE
123
- PS C:\> Install-DbaMaintenanceSolution -SqlInstance RES14224 -Database DBA -InstallJobs -BackupLocation "Z:\SQLBackup" -CleanupTime 72 -ReplaceExisting
129
+ PS C:\> $params = @{
130
+ >> SqlInstance = 'RES14224'
131
+ >> Database = 'DBA'
132
+ >> InstallJobs = $true
133
+ >> BackupLocation = 'Z:\SQLBackup'
134
+ >> CleanupTime = 72
135
+ >> ReplaceExisting = $true
136
+ >> }
137
+ PS C:\> Install-DbaMaintenanceSolution @params
124
138
125
139
This will drop and then recreate the Ola Hallengren's Solution objects
126
140
The cleanup script will drop and recreate:
127
- - TABLE [dbo].[CommandLog]
128
141
- STORED PROCEDURE [dbo].[CommandExecute]
129
142
- STORED PROCEDURE [dbo].[DatabaseBackup]
130
143
- STORED PROCEDURE [dbo].[DatabaseIntegrityCheck]
131
144
- STORED PROCEDURE [dbo].[IndexOptimize]
132
145
146
+ The tables will not be dropped as the `LogToTable` and `InstallParallel` switches are not enabled.
147
+ - [dbo].[CommandLog]
148
+ - [dbo].[Queue]
149
+ - [dbo].[QueueDatabase]
150
+
133
151
The following SQL Agent jobs will be deleted:
134
152
- 'Output File Cleanup'
135
153
- 'IndexOptimize - USER_DATABASES'
0 commit comments