Metrics install automatically if you have Redgate Monitor installed.
If you are using Redgate’s SQL Server monitoring tool, Redgate Monitor, you can instantly install and run this metric on your servers.
This metric tells you whether a database is online, restoring, recovering, recovery pending, suspect, emergency, offline or does not exist on the server. It is a matter for concern if the database is not online for any reason, but more so if the database state is suspect, emergency, or offline.
Metric definition
Name
Database state
Description
This metric tells you what state a specific database is in. The values translate as follows: 0 = ONLINE, 1 = RESTORING, 2 = RECOVERING, 3 = RECOVERY_PENDING, 4 = SUSPECT, 5 = EMERGENCY, 6 = OFFLINE, 7 = Database Does Not Exist on Server.
The T-SQL query that will collect data
Instances to collect from
Select all
Databases to collect from
master
Collection frequency
600
Use collected or calculated values
Leave the Use a calculated rate of change between collections check box unchecked
Metric collection
Enabled
Alert definition
Alert name
Database not online
Description
Raise an alert when the metric value goes
Above the defined threshholds
Default threshold values
High: | 3 |
Medium: | 1 |
Low: | 0 |
Note: Alert thresholds are directly linked to the integer values of the Database state metric on which the alert is based. By default, any value over 0 (ONLINE) requires attention. Values 1 (RESTORING) and 2 (RECOVERING) are common states, but do mean the database is unusable while the database. Values of 3 (RECOVERY_PENDING) and higher (4 = SUSPECT, 5 = EMERGENCY, 6 = OFFLINE, 7 = Database Does Not Exist on Server) indicate that the database will not be available without user intervention. These thresholds are intended as guideline values. If they seem too high or too low, replace them with values more suited to your own server performance.
Raise an alert when the threshold is passed for
1 collection
Alert is
Enabled