May 16, 2018 at 7:08 am
Hi there
Anyone with PBM experience out there? I've created a policy that checks for Database Status (so should fail unless state = NORMAL. Unfortunately it won't report on databases that are Offline which is not ideal. Any suggestions?
Thanks
Doodles
May 16, 2018 at 9:26 am
DP
May 16, 2018 at 9:35 am
Ok, just tried it. I get the same thing. Will keep looking.
May 16, 2018 at 9:37 am
Looks like it's a bug: http://pietervanhove.azurewebsites.net/?p=1151
May 16, 2018 at 10:02 am
A lot of the pieces in PBM aren't generic enough to capture what you need. And using the "Normal" status of the Database facet won't capture what you need. If it's really just the same as selecting from sys.databases where state desc is not 'ONLINE', then you can create your own custom conditions. Don't know if you ever heard of it but it's a barely documented procedure using ExecuteSQL(). For more info, refer to the:
ExecuteSql()
And this is a good example of using ExecuteSQL() for PBM:
Creating custom T-SQL conditions and policies for SQL Server Policy Based Management
It's great to learn to do this and isn't hard. It makes PBM a lot more flexible, powerful.
Sue
May 17, 2018 at 8:11 am
Beatrix - thanks for testing, and for finding the bug, really appreciate it 🙂
Sue - thanks for the suggestion, i have seen some great examples with ExecuteSql() and definitely want to explore further now! Thanks 🙂
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply