Monitor Database Events

This metric queries data from an Extended Events session to detect databases being dropped, created, started, stopped, attached or detached. It assigns a configurable “anxiety index” value (an integer from 1-10) to each detected event and then calculates a total based on the occurrences of these events over a period. First, create and start for […] Read more

Monitor TempDB Contention

4,745 0
Measures the total duration of latch waits on the tempdb database, in a one-minute time interval. First, create and start for the following Extended Events session on the monitored SQL Server instance: [crayon-66a242bdcfe1f081550922/] The goal is to get the total duration of latch waits, in the last minute, so this session collects all the event […] Read more

Monitoring Changes in Permissions, Users, Roles and Logins

7,047 0
Reports the number of changes to logins, users, roles in the past 10 minutes. It measures every change but doesn’t tell you if this is a drift from what it should be, since it might only be a permission being temporarily created and then revoked. First, create the following function in the database on the […] Read more

Detect Suspicious Errors Typical of a SQL Injection Attack

7,754 0
Detects errors characteristic of a possible SQL Injection attack, or other attempts to gain illicit access to a database server. Returns the number of errors detected in the last 20 minutes. First, create an Extended Events session on the monitored SQL Server instance: [crayon-66a242bdd0420157523423/] Start the event session, like this: [crayon-66a242bdd0428276627033/] Read more

Jobs without notification

3,670 0
SQL Agent can be configure to notify an operator when a job fails. While failed jobs also surface in the monitoring, proactive notification often allows for a quicker response. Read more

Total database file size

This custom metric measures the total database file size (data files and log file combined). An increase in this metric signals that a database was grown. When not done by the DBA, this is an autogrow. Excessive autogrow events should be prevented as this can result to file fragmentation. Try to manually grow files before […] Read more