Reduce false positives due to log shipping / Mirroring
On secondary server for log shipping/mirroring false positives can be generated for overdue backups/databases unavailable. If these technologies are used for DR purposes then having the checks ignored is unsafe. It is trivial to filter these out with the below code and I'm sure there is something similar in place for Availability Group databases already.
SELECT *
FROM sys.databases
WHERE name NOT IN (SELECT secondarydatabase FROM msdb.dbo.logshippingsecondarydatabases UNION SELECT dbname(databaseid) FROM msdb.sys.databasemirroring WHERE mirroringrole_desc = 'MIRROR')
18
votes
Mat
shared this idea