2022 Developer Survey is open! Take survey.

Hot answers tagged

9 votes
Accepted

MongoDB - Replication Oplog Window has gone below 1 hours

If replication OpLog window goes under one hour, it means that timestamp between first and last lines in the OpLog is under one hour. This can happen when there is lots of changes in the DB and your ...
user avatar
  • 5,153
8 votes
Accepted

Change character limit of SQL Agent Operators

Just because you can does not mean you should. Please do not apply the changes below. This answer is only to show you why you should not change system tables or system procedures and what can go wrong....
user avatar
7 votes
Accepted

Alert when Job isn't triggered

I have managed to find one solution to this, although it's not as neat as I would have preferred. I've created a second job that checks the last run date on my target job. This is scheduled to run ...
user avatar
7 votes
Accepted

Why is deadlock alert not working?

Probably the error 1205 is not set up to be logged in ERRORLOG. Look it up in sys.messages: SELECT * FROM sys.messages WHERE message_id = 1205; If the column is_event_logged is set to 0, change it ...
user avatar
  • 10.9k
6 votes
Accepted

How do I create a SQL Agent Alert on a custom error message in SQL Server 2012?

Please refer to Create a User-Defined Event By default, user-defined messages of severity lower than 19 are not sent to the Microsoft Windows application log when they occur. User-defined messages ...
user avatar
  • 61.1k
6 votes
Accepted

Throw and RaiseError of level 16 do not cause alert to occur

From reading the BOL article on sp_add_alert [ @severity = ] severity - The severity level (from 1 through 25) that defines the alert. Any SQL Server message stored in the sysmessages table sent to ...
user avatar
5 votes

SQL Server alerts not sending notification emails to the operator

Check SQL Server Agent Properties: on the "Alert System" page, is "Enable mail profile" checked? Sometimes with new installations, after I set up options on that page I've found notification emails ...
5 votes
Accepted

DBA Blocking Query Email Alert

I wrote Blocking Detector which uses event notification. You can find it here Below is how it works : This script will create - a blocking detection alert - table to hold blocking ...
user avatar
  • 61.1k
5 votes
Accepted

Getting “SQL Server Alert System: 'Alert Severity 20' occurred” error occasionally

Check the SQL Server error log and you will find a corresponding log message that includes the IP address of the originating system. This will be the most important clue to investigating what is ...
user avatar
  • 7,753
5 votes
Accepted

Error Severity 16 Alert being raised for events where is_event_logged = 0

Only events that are send to the application event log of windows can be used for alerting. This can be done with RAISERROR when WITH LOG is specified see documentation The following code will ...
user avatar
4 votes
Accepted

Why does everyone want me to create an alert for severity 025?

Severity 25 is a 'catch-all' fatal system error. A severity 25 error is a fatal system error. I have heard that severity 25 is more or less a catch-all for miscellaneous fatal errors. I have ...
user avatar
4 votes

How to find High CPU queries

Please look at the three main queries in the following answer (of mine): SQL Server performance: PREEMPTIVE_OS_DELETESECURITYCONTEXT dominant wait type The first query looks at currently running ...
user avatar
4 votes
Accepted

Raising an Alert with THROW

No, THROW is missing some RAISERROR functionality, including WITH LOG. I blogged about this back when SQL Server 2012 was still in beta, and no changes have been made since: SQL Server v.Next (Denali)...
user avatar
4 votes

Setting Up SQL Alerts

One option would be to handle some of this logic inside your code running in the job... this works if you are doing things in batches, or if you are using a cursor or something similar. Procedure to ...
user avatar
  • 3,488
4 votes

How to set email alerts for high IO errors (sql server error log)?

The error number is 833, so it is just a matter of setting up an Agent Event Alert based on that error number. The number isn't written to eventlog by default, however, so you need to configure that ...
user avatar
3 votes
Accepted

Cpu% usage alert is not working for 'alert if counter=raises above'

I am only able to get SQL Server 2012 to fire an alert based upon the "Workload Group Stats -> CPU Usage %" if I enable a dummy Resource Governor classifier function that classifies all connections ...
user avatar
  • 67.1k
3 votes
Accepted

What are some important security-related error codes / events to monitor?

It's a good idea to create SQL alerts in the SQL agent for all errors of severity 16 through to 25. Also create 1 SQL alert for each of these error IDs 823 824 825. I would create an operator that ...
user avatar
3 votes

SSPI handshake failed with error code 0x8009030c, state 14

WORKAROUND/SOLUTION Loopback check can be removed by adding a registry entry as follows: Edit the registry using regedit. (Start –> Run > Regedit ) Navigate to: HKLM\System\CurrentControlSet\Control\...
user avatar
  • 41
2 votes
Accepted

SQL Server Alerts on VMs

I would suggest that they are equally important on physical or VMs. suggest you to create all critical alerts as highlighted by Glenn Berry.
user avatar
  • 61.1k
2 votes

Random and constant "Log Growths" Alerting, how to make it stop?

This is no error. It is just a log file which was too small and has auto growth enabled. It means that while there are transactions running the sql server process has to expand the log file. Expanding ...
user avatar
  • 1,209
2 votes
Accepted

Random and constant "Log Growths" Alerting, how to make it stop?

This is telling you that a or several transaction logs are growing repeatedly, which means it is set to FULL or BULK LOGGED recovery mode with no or insufficient transaction log backups, or someone ...
user avatar
  • 7,353
2 votes
Accepted

Can I create alert on ora-20118 from Enterprise Manager?

You could use DBMS_SYSTEM.KSDWRT to write the error to the alert log when you catch the relevant exception. Then you can configure Enterprise Manager to alert on that error code. You've two options ...
user avatar
2 votes
Accepted

What is preventing ORA-00376 errors appearing in the alert log?

Oracle provides the following information for this error message: ORA-00376 file string cannot be read at this time Cause: An attempt was made to read from a file that is not readable. Most likely ...
user avatar
2 votes
Accepted

How can I have SQL Server send Job Notification alerts to an API

So you need SQL Server to make an HTTP call. There's nothing in T-SQL to do this directly. You will need to engage one of the general-purpose programming embeddings it supports. Your own suggestion of ...
user avatar
2 votes
Accepted

How to script alerts in SQL Server?

I was able to get all the properties scripted out. Open SSMS Right click on the job Click properties Use script button on the top I created a test job with many features. This is what I get when I ...
user avatar
  • 12.2k
2 votes
Accepted

How to know exactly when my Database / Log files grew?

Here is a script that I use. I don't remember the source, but it is handy, as it will show you the growth events. DECLARE @filename NVARCHAR(1000); DECLARE @bc INT; DECLARE @ec INT; DECLARE @bfn ...
user avatar
  • 634
2 votes
Accepted

Does the @raise_snmp_trap do anything in @sp_add_alert?

msdb.dbo.sp_add_alert calls msdb.dbo.sp_add_alert_internal, which in turn writes values into the msdb.dbo.sysalerts table. The sysalerts table insert looks like this: INSERT INTO msdb.dbo.sysalerts ...
user avatar
  • 67.1k
2 votes
Accepted

How do I automatically enable or disable report jobs at AOAG failover?

As it turns out, AOAG event ID #35266 quite regularly occurs 2 or 3 times as a node is coming up or down. So long as what you do when a 35266 is detected isn't toggle-like in nature, you should be OK. ...
user avatar
2 votes
Accepted

Job duration email

I find I receive more help and the help is more detailed when I'm very specific in my questions. I liked the detail of the tagging and the questions, it lets me know roughly what you would want and ...
user avatar
  • 3,012

Only top scored, non community-wiki answers of a minimum length are eligible