scom missing performance counters

I recently had to make some changes to my scom test environment server. It’s a single virtual machine with scom, sql, ssrs, the works on it. Despite what one would think, it has performed well with about 30 agents. Recently I added about that many more and it pushed up the ram to the 4gb max that I had given it. When I added more I realized I had used 2008 x32 for the OS (oops) and was not able to see the extra ram. After some research I found that I could do an upgrade from 2008 standard to enterprise, which is what I did. Afterwards, scom wouldn’t run because the SDK service would not start. This is the event log message.

Log Name:      Operations Manager
Source:        OpsMgr SDK Service
Date:          1/7/2011 2:25:48 PM
Event ID:      26380
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:     

Description:
The System Center Operations Manager SDK Service failed due to an unhandled exception. 
The service will attempt to restart.
Exception:

System.TypeInitializationException: The type initializer for ‘Microsoft.EnterpriseManagement.Mom.ServiceDataLayer.SdkDataAccess’ threw an exception. —> System.InvalidOperationException: The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.
   at System.Diagnostics.PerformanceCounter.Initialize()
   at System.Diagnostics.PerformanceCounter.set_RawValue(Int64 value)
   at Microsoft.EnterpriseManagement.Mom.Internal.PerformanceCounterCategoryDescriptor.SingleInstancePerformanceCounterCategoryManager.CreateCounter(String categoryName, String counterName)
   at Microsoft.EnterpriseManagement.Mom.Internal.PerformanceCounterCategoryDescriptor.SingleInstancePerformanceCounterCategoryManager.CreateCounters(PerformanceCounterCategoryDescriptor categoryInfo)
   at Microsoft.EnterpriseManagement.Mom.Internal.PerformanceCounterCategoryDescriptor.SingleInstancePerformanceCounterCategoryManager..ctor(String instanceName, PerformanceCounterCategoryDescriptor categoryInfo)
   at Microsoft.EnterpriseManagement.Mom.Internal.SingleInstancePerformanceCounterCategoryDescriptor.CreateManager()
   at Microsoft.EnterpriseManagement.Mom.ServiceDataLayer.SdkPerfCounterManager..ctor()
   at Microsoft.EnterpriseManagement.Mom.ServiceDataLayer.SdkDataAccess..cctor()
   — End of inner exception stack trace —
   at Microsoft.EnterpriseManagement.Mom.ServiceDataLayer.SdkDataAccess.Initialize()
   at Microsoft.EnterpriseManagement.Mom.Sdk.Service.SdkSubService.AsyncStartCallback(Object notUsed)
   at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="OpsMgr SDK Service" />
    <EventID Qualifiers="49152">26380</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2011-01-07T19:25:48.000Z" />
    <EventRecordID>10025424</EventRecordID>
    <Channel>Operations Manager</Channel>
    <Computer>INFMGT52.accessgeneral.com</Computer>
    <Security />
  </System>
  <EventData>
    <Data>System.TypeInitializationException: The type initializer for ‘Microsoft.EnterpriseManagement.Mom.ServiceDataLayer.SdkDataAccess’ threw an exception. —&gt; System.InvalidOperationException: The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.
   at System.Diagnostics.PerformanceCounter.Initialize()
   at System.Diagnostics.PerformanceCounter.set_RawValue(Int64 value)
   at Microsoft.EnterpriseManagement.Mom.Internal.PerformanceCounterCategoryDescriptor.SingleInstancePerformanceCounterCategoryManager.CreateCounter(String categoryName, String counterName)
   at Microsoft.EnterpriseManagement.Mom.Internal.PerformanceCounterCategoryDescriptor.SingleInstancePerformanceCounterCategoryManager.CreateCounters(PerformanceCounterCategoryDescriptor categoryInfo)
   at Microsoft.EnterpriseManagement.Mom.Internal.PerformanceCounterCategoryDescriptor.SingleInstancePerformanceCounterCategoryManager..ctor(String instanceName, PerformanceCounterCategoryDescriptor categoryInfo)
   at Microsoft.EnterpriseManagement.Mom.Internal.SingleInstancePerformanceCounterCategoryDescriptor.CreateManager()
   at Microsoft.EnterpriseManagement.Mom.ServiceDataLayer.SdkPerfCounterManager..ctor()
   at Microsoft.EnterpriseManagement.Mom.ServiceDataLayer.SdkDataAccess..cctor()
   — End of inner exception stack trace —
   at Microsoft.EnterpriseManagement.Mom.ServiceDataLayer.SdkDataAccess.Initialize()
   at Microsoft.EnterpriseManagement.Mom.Sdk.Service.SdkSubService.AsyncStartCallback(Object notUsed)
   at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)</Data>
  </EventData>
</Event>

After some research I found this article from Microsoft that contains instructions on how to fix this problem.

cleaning up the default management pack

SCOM has what I feel is a major bug in that it will allow you to save items (monitors, rules, overrides, etc.) in the default MP. Doing this is bad for a lot of reasons, and not only does SCOM allow you to do this, but it is the default option as well. In my case it turned out that an occasional lack of attention allowed me to do this and then removing MP’s later becomes a huge pain in the rear. Anyway I found this good article on how to clean up the mess.