Showing posts with label enabled. Show all posts
Showing posts with label enabled. Show all posts

Sunday, March 25, 2012

Alerts Not Working

I defined an Alert in Enterprise Manager for Severity 19 - Fatal Error In Resource. The alert is enabled, the type is "sql server event alert" and the alert is defined against a specific database. SQLSERVERAGENT and SQL Mail session are both started. I test the alert using the following statement in the specified database.

raiserror (50001,19,1) with log

A message is placed in the SQL Server log, however no alert is fired. The alert history indicates the alert has never occurred. What am I missing?

Thanks, DaveHere's an update.

I refreshed EM earlier in the day and still saw no history. This time I disconnected and reconnected the instance. For some reason I have to do this in certain situations. After reconnecting I noticed a history existed under a demo for Severity 19. I didn't realize the demos were enabled. I just disabled the demo alert and all appears to be working.

Thanks, Dave|||all the demos are enabled for each of the severity levels if you are defining errors soley based on severity they will as you found out hit first
also ...
[BOL] Says

Error messages with a severity level of 19 or higher stop the current batch. Errors messages with a severity level of 20 or higher are considered fatal errors and terminate the client connection. Errors messages in this range may affect all of the processes in the database, and may indicate that a database or object is damaged. Error messages with a severity level from 19 through 25 are written to the error log.

you might want to consider refining your alert to fire on the event id's that are acutally being thrown..
just a suggest

by the way good debugging on your part.|||The error message I'm seeing is being generated by a vendor's software package.

Error: 1204, Severity: 19, State: 1
The SQL Server cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users or ask the system administrator to check the SQL Server lock and memory configuration..

There are multiple performance problems associated with this application. I suspect the error above is connected to many of the problems. I don't believe the database is damaged. I'm guessing it's just a matter of poorly written code. Now I have to figure out how to setup Profiler to look for this error.

Thanks, Dave|||http://www.sql-server-performance.com/deadlocks.asp to prevent deadlocks and error defined.

Ensure to run the statement in batches if it is affecting large number of rows. Another option is to specify a hint like table or page lock so that the number of locks can be reduced.

What are lock settings defined at SQL server?|||The lock setting is still at the default of 0. I'm not sure what code is causing this problem to occur. I need to setup Profiler to trap the logic. I just setup Profiler to look for Severity 19, but the filter does not appear to be working. I'm still seeing all server activity. Am I missing something?

- Filters
- Severity
- Equals 19

Dave|||Oh, then follow this link http://www.sql-server-performance.com/blocking.asp to monitor the blocking and capture the trace.|||Not missing much about profiler. Any null value is returned as a valid hit. You may want to just run profiler to a table with the SQL statement complete, RPC complete, and some of the error events getting logged. Once you have a pile of data in a table, you can run queries off of that for severity 19, then try to work back via the identity column to figure out what statement did it.|||Can you tell Profiler to ignore NULL?

I'll give your suggestion a try.

Thankssql

Sunday, February 12, 2012

After enabling named pipes and disabling again, not able to start engine

I enabled then disabled named pipes. Now when I try to start the SQL Engine, I get this error:

TITLE: Connect to Server

Cannot connect to ****** (replaced my servername with stars here for privacy).


ADDITIONAL INFORMATION:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476


BUTTONS:

OK

found it, I had also enabled IP1 and IP2 which prevented me from connecting it apears|||It also seems that there's a bug in ASP.NET that prevents the Named Pipes protocol from being able to be used in default setup configuration. Perhaps this isn't experienced by many people as TCP/IP connections are also enabled by default and they work. Have a look here:

BUG: Named pipes do not work when worker process runs under ASPNET account
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q315159

I've found this really annoying (at least now I've found that it's really a bug, and not something I had misconfigured), as I had disabled TCP/IP for security reasons.

After enabling named pipes and disabling again, not able to start engine

I enabled then disabled named pipes. Now when I try to start the SQL Engine, I get this error:

TITLE: Connect to Server

Cannot connect to ****** (replaced my servername with stars here for privacy).


ADDITIONAL INFORMATION:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476


BUTTONS:

OK

found it, I had also enabled IP1 and IP2 which prevented me from connecting it apears|||It also seems that there's a bug in ASP.NET that prevents the Named Pipes protocol from being able to be used in default setup configuration. Perhaps this isn't experienced by many people as TCP/IP connections are also enabled by default and they work. Have a look here:

BUG: Named pipes do not work when worker process runs under ASPNET account
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q315159

I've found this really annoying (at least now I've found that it's really a bug, and not something I had misconfigured), as I had disabled TCP/IP for security reasons.