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

Maintenance Solution retention time check issues #835

Closed
1 of 2 tasks
mikedavem opened this issue Mar 15, 2021 · 1 comment
Closed
1 of 2 tasks

Maintenance Solution retention time check issues #835

mikedavem opened this issue Mar 15, 2021 · 1 comment

Comments

@mikedavem
Copy link
Contributor

mikedavem commented Mar 15, 2021

Bug Report

General Troubleshooting steps

  • [X ] Verified running the latest release of dbachecks?

2.0.9

  • [ X] Verified errors are not related to permissions?
  • Can duplicate in new/clean PowerShell session (clean = powershell -NoProfile)?

Version Information

  • Operating System : Windows Server 2016 / Windows 10
  • PowerShell Version: 5.1
  • SQL Server (Edition|Version): EE/2017

Steps to Reproduce

When policy.ola.DeleteBackupHistoryCleanUp value is over 2 digits the check is failing.
Let's say I want to keep more 2 years of backup history (~730days) , the check is designed to keep only 2 digits -> 73

  • [X ] Attach any screenshots (if possible/allowed)

image

  • Attach output from PowerShell console (if possible/allowed)

Description of Bug

The description of the parameter doesn't suggest any limits for days

image

but the related check code is limited to 2 digits

$days = [regex]::matches($jobsteps.Command, "dd,-(\d\d)").groups[1].value

We could improve the code as follows to make detection more dynamic:

$days = [regex]::matches($jobsteps.Command, "dd,-(\d*)").groups[1].value

The same applies for

  • File Job Cleanup Time
  • Delete Backup History Cleanup Time
  • Delete Purge History Cleanup Time
@mikedavem mikedavem changed the title Maintenance Solution Check DeleteBackupHistory retention Maintenance Solution retention time check issues Mar 15, 2021
@SQLDBAWithABeard
Copy link
Collaborator

Closed with 35bb787

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants