Tuesday, August 10, 2010

EventID 4502 and how to troubleshoot it on a SQL Server 2008 server

Even though I blogged earlier about this EventID, I bumped into this issue sometime ago again. Now it happened on a SQL Server 2008 server.

The OpsMgr event log of the RMS showed this error many times:
image

Contents:

Log Name:      Operations Manager
Source:        HealthService
Date:          xxxxxxxxxxxxx
Event ID:      4502
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      xxxxxxxxxxxx
Description:
A module of type "Microsoft.EnterpriseManagement.Mom.DatabaseQueryModules.GroupCalculationModule" reported an exception System.Data.SqlClient.SqlException: Execution of user code in the .NET Framework is disabled. Enable "clr enabled" configuration option.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

Here CLR (Common Language Runtime) has to enabled as well in order to solve this issue. But how to go about it on a SQL Server 2008 server?

I run this Stored Procedure against the OpsMgr DB. Restarted the Health Service on the RMS and the errors did not appear any more.

When you experience the same issue as described above but you run SQL 2005 Server, go here in order to get information how to solve it.

2 comments:

Jonathan said...

Hi Marnix,

CLR is enabled during the OpsDB setup process, so usually this issue will not present itself unless a SQL DBA explicitly disabled CLR after the OpsDB setup completed. This error also commonly pops up after moving the OpsDB to another SQL instance, because CLR isn't enabled in a default installation of SQL and enabling CLR isn't something that is well documented in a database move procedure.

Marnix Wolf said...

Hi Jonathan.

I know about CLR which is enabled by default. Also that when moving the SCOM DB it has to enabled on the new SQL server hosting that DB. But sometimes CLR stops. I have seen issues like this happening after a bad (home tailored) MP had been imported.

Cheers,
Marnix