Tuesday, July 21, 2009

Error 5009.Registration of BAM performance counters failed. Return code -1.

Post from: http://blogs.msdn.com/balachandra/archive/2008/10/20/error-5009-registration-of-bam-performance-counters-failed-return-code-1.aspx

In one of my project I was remote installing BizTalk server on the dev machine and I encountered a strange error. "Error 5009. Registration of BAM performance counters failed. Return code -1." I searched and digged in for a solution and found that the performance counter registry may be damaged and the counters need to rebuilt. One of the forum thread suggested the use of lodctr exe with /r option for rebuilding counters. I tried however din't work for me. Let me tell you that my dev machine was running Windows 2003 server and I was not sure whether /r option was supported in that version of lodctr as the help text(use /?) did not show the option however though it showed the option /R: which restores performance registry strings from the specified filename. I also tried to restore PerfStrinBackup.ini file, din't work either. Then I tried the lodctr exe in Vista OS. This version supported the required option. I copied this version of exe to the dev machine and tried executing "lodctr /R". bingo! It worked!!. However please note I don't say that this is the right solution because there may be licencing issues associated in using Vista components in Windows 2003.