Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install-DbaMaintenanceSolution drops existing table CommandLog when using switch parameter -ReplaceExisting and doesn't create a replacement #9553

Open
nanoDBA opened this issue Nov 21, 2024 · 0 comments
Labels
bugs life triage required New issue that has not been reviewed by maintainers

Comments

@nanoDBA
Copy link

nanoDBA commented Nov 21, 2024

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

No error: silent drop unless -Verbose switch is used
With -Verbose:
Performing the operation "Dropping all objects created by Ola's Maintenance Solution" on target "server02".

Steps to Reproduce

$paramHash = @{
  SqlInstance      = 'server02'
   Database        = 'Maintenance'
   SqlCredential   = $someCred
   Verbose         = $True
   InstallParallel = $True
   ReplaceExisting = $True
}
Install-DbaMaintenanceSolution @paramHash

image

If -LogToTable is specified the CommandLog table will still be dropped, but a new version of the table will be created. Without param -LogToTable param -ReplaceExisting will not replace the CommandLog table. The table is simply dropped, creating a breaking condition as the Ola sprocs will not fire without the table present if @LogToTable = 'Y' is in use.

Please confirm that you are running the most recent version of dbatools

2.1.28

Other details or mentions

Ola Hallengren Maintenance Solution stored procedures are replaced by newer versions, CommandLog table should be left alone if it already exists. Perhaps a separate switch(es) for less destructive behavior is warranted?

What PowerShell host was used when producing this error

PowerShell Core (pwsh.exe)

PowerShell Host Version

Name Value


PSVersion 7.4.6
PSEdition Core
GitCommitId 7.4.6
OS Microsoft Windows 10.0.14393
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

SQL Server Edition and Build number

Microsoft SQL Server 2019 (RTM-CU29-GDR) (KB5046860) - 15.0.4410.1 (X64)
Oct 23 2024 15:50:49
Copyright (C) 2019 Microsoft Corporation
Standard Edition (64-bit) on Windows Server 2019 Datacenter 10.0 (Build 17763: ) (Hypervisor)

.NET Framework Version

.NET 8.0.10

@nanoDBA nanoDBA added bugs life triage required New issue that has not been reviewed by maintainers labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs life triage required New issue that has not been reviewed by maintainers
Projects
None yet
Development

No branches or pull requests

1 participant