dbatools, DbcCheck LastBackup Last week I started testing dbccheck on my test system. I found one strange thing, and I have no idea what is the problem, last fullbackup is few hours old, but dbccheck print an error.

Following you can see my steps:

installation dba checks


based on the blog from chrissy lemaire (thank you chrissy,for that great job)


change configuration

Set-DbcConfig -Name policy.backup.fullmaxdays   3
Set-DbcConfig -Name policy.backup.logmaxminutes 720


first check

$server = "ALET21"
Invoke-DbcCheck -SqlInstance $server -Check LastBackup


here the result:

result DbcCheck

The dbccheck print an error

I did the same test with PS Command, following you can see the results: 

result PS command

any idea what is the problem?

AdminDB DB is not new, creation date was on 23.11.2016. I also updated the policy.backup.newdbgraceperiod to 1, but I have the same problem, as you can see below:



It looks like the dbacheck module is up to date:
I am going to assume that this database (AdminDB) is newly created and newly backed up?

There was an issue created for this as new databases were failing these tests.
https://github.com/sqlcollaborative/dbachecks/issues/207

A new configuration was created "policy.backup.newdbgraceperiod" (defaulting to value 0 for 0 hours) that excludes new databases created.
For example, it defaults to 0 so it includes all new databases e.g. (Get-Date).AddHours( - (policy.backup.newdbgraceperiod) )



As you can see, the new database QuickBackup fails.

Now when we allow a grace period of 1 hour for new databases:

Set-DbcConfig -Name policy.backup.newdbgraceperiod -Value 1




Our new database is excluded now: