Thursday, August 20, 2009

EventID 4000, ‘GetSQL2008DBSpace.js : 0:’

Had this strange issue at a customers site this morning. SQL 2008 servers are being monitored by OpsMgr R2. SQL MP was loaded and properly configured. Also DMO (as described here) was installed on all SQL 2008 servers. All SQL servers but one were doing just fine and were being monitored properly by OpsMgr. The problematic SQL server however kept logging EventID 4000, ‘GetSQL2008DBSpace.js : 0:’ even though DMO was installed:

So I repaired the installation of DMO, restarted the Agent on the server, and no, the error came back. Removed DMO, reinstalled it and after a restart, the error came back.

Hmm. Strange. Looks like some components don’t land properly. So time for some searching. Since DMO is part of backward compatibility components, I looked for DMO related files in the folder: C:\Program Files\Microsoft SQL Server\80. Here two other folders are to be found as well: Tools and COM. Opened the Tools folder to find the folder Binn. There I found a dll with a nice name: SQLDMO.DLL.

Could it be that somehow this dll didn’t get registered? So I opened an elevated cmd-prompt, gave a cd-cmd in order to get to the right folder (cd C:\Program Files\Microsoft SQL Server\80\Tools\Binn), and gave this command: regsvr32 SQLDMO.DLL.

After a couple of seconds I got this message:

Restarted the Agent on the server, and now no more events with EventID 4000 appeared. After 10 minutes or so this SQL server appeared in OpsMgr and is being monitored now completely.

So whenever EventID 4000 keeps coming back on a SQL 2008 server, even when DMO has been installed as described in the SQL MP guide, there might be an issue with the dll (SQLDMO.dll) not being registered. Do it manually and then all is OK.


kaolga said...

I tried to re-register SQldmo but got the error message:
Microsoft Visual C++ Runtime Library
Runtime Error!

Program: C:\Windows\system32\regsvr32.exe


An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.


[Window Title]

The module "SQLDMO.DLL" failed to load.

Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files.

A dynamic link library (DLL) initialization routine failed.


I tried repare backward compatobility sql 2005 and re-register again, but no luck.

Could someone help please?
thank you

Marnix Wolf said...

Hi Kaolga.

Did you run the installation of DMO with elevated permissions? And when trying to register the dll run it from an elevated cmd-prompt. Hope this helps.


kaolga said...

DMO was already installed, i just repared it. I understand it comes from sql 2005 Backward compatibility option.
Should i remove DMO and re-install?
I registered sqldmo with administrator permissions but got the run time error.
What else should i try?
Thank you

Marnix Wolf said...

Hi Olga.

Indeed, DMO comes from the 2005 Backward compatibility option. YOu could try to remove it and reinstall it. Always make a valid backup of the server before doing that so there is always a way back.


Framework said...
This comment has been removed by a blog administrator.