Database state

| 0 comments | 4,173 views

VN:F [1.9.17_1161]
Rating: 1.0/5 (1 vote cast)

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.

Database state, 1.0 out of 5 based on 1 rating

Metric definition

Metric Name:
Database state
Note: Insert the name of the database whose state you're monitoring.
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.
Enter the T-SQL query that will collect data:
select coalesce(max(state),7)
from   sys.databases
where name = '<DatabaseName>' --the name should match the metric name ;
Select instances to collect from:
Select all
Note: Alternatively, select the instance on which the specific database you're monitoring exists.
Choose databases to collect from:
Specify databases and type
Set collection frequency:
Collect data every 10 minutes
Use collected or calculated values:
Leave the Use a calculated rate of change between collections check box turned off
Metric collection is:

Alert definition

Alert name:
Database not online
This alert is based on the Database state metric. The alert is raised when the database state is no longer online.
Raise an alert when the metric value goes:
Above the defined thresholds
Default threshold values:
Set the thresholds as follows:
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:
Enter 1 collection
This alert is:
VN:F [1.9.17_1161]
Rating: 1.0/5 (1 vote cast)