How does the rule "DBSS - Unavailable" work in a mirrored environment?
Here is how the rule "DBSS - Unavailable" works in a mirrored environment:
The rule is working with the DB status which we get from the SQL Server database. Open the Management Studio and the properties of a database there you will find the property "Status". Some states are defined as unavailable. The rule works as follows
An alarm fires when a SQL Server database is detected as having the status "Unavailable" or for a principal database that takes part in a mirroring operation, having the status "Restoring".
The rule is defined on the "DBSS_Database" topology. The rule condition is basically checking:
"#DBSS_Unavailable_For_Rules# >= 1"
Whereas "#DBSS_Unavailable_For_Rules#" is a derived metric which is based on "db_status" metric. It’s calculation consists of checking if the current DB is excluded (set in the "Global Administration" dashboard not to fire "DBSS – Unavailable" alarms about the specified DBs) afterwards the calculation checks if the DB which is part of mirroring and holds the "MIRROR" role and also it’s "Restoring". If both checks are false then the derived metric will hold a value according to the "db_status" metric.
To find the DB status in Foglight, go to: Configuration | Data | Databases | SQL Server | Reports | Get Instances | Databases | <your DB name> | DB Status
If there is no data, open the right panel and click on "Property Viewer". Under "DB Status" you will find the current and the historical states.