I am adding an alert when a user logs into an application, if the Microsoft SQL database maintenance plan failed, did not run, was not implemented OR was never scheduled. I would prefer not to add a setting to identify the maintenance plans which should be checked.
How can I get a list of maintenance plans which perform any action on the current database "SELECT db_name()
"?
I can see the list of all maintenance plans here: SELECT * FROM msdb.dbo.sysmaintplan_plans
I'm guessing that I'll need to query the plan steps and check if any contain my database.
It would be nice to be able to identify the type of each step, ie: Integrity check, Index rebuild, statistics update or backup, etc... Then I could ensure all the required steps are being accomplished.