数据库WMI 0x80041010 如何解决?

事件起因:

     由于要做第二次机房收费系统,而数据库是必不可少的.但是自己之前已经装好了VS2010,在和数据库连接的时候提醒我不支持SQL2010,支持2005以及更高的版本(不过后来开会知道并不是不可以用,需要一些设置就可以了,不过那时候我已经卸载SQL2000已经装好SQL2008),因为自己之前担心SQL2000会删不干净.于是在删除之前做了一下准备,在网上查了查相关资料.本次问题的起因和自己删除SQL2000有关,在删除SQL2000的时候有一些文件删除不掉.文件夹地址是 "C:\Program Files\Microsoft SQL Server"然后我就一时糊涂的把这里的文件给删掉了.后来再装SQL2008的时候马上就要结束的时候出现了错误,不能经常安装,我估计是我误删文件了.之后让争光帮忙把文件夹下的文件给我拷贝一份.然后再次安装.成功!

但是安装成之后当我打开配置管理选项的时候出现了以上图片显示的错误.

出现了以上的问题如何解决呢?

clip_image001

知识点:WMI(Windows Management Instrumentation,Windows 管理规范)是一项核心的 Windows 管理技术;用户可以使用 WMI 管理本地和远程计算机。这个知识仅仅做一个了解以后用到再深入学习.

那就开始从网上找吧,不过在我找之前脑子里闪现了一个想法,自己之前都是通过百度找到相关的问题解决方案,而自己一个寒假几乎都在学英语做找英语资料的工作,这次也尝试一下到国外的网站去找相关的问题解决方案.仅仅做一个尝试.

找到了相关的资源

第一种:

SQL Server - WMI Error 0x80041010 - Invalid Class

Recently I started experiencing WMI repository corruption that results in inability to open SQL Server Configuration Manager with the following error message:

Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager.

Invalid class [0x80041010]

At this point if I browse WMI repository under root\microsoft\sqlserver\computermanagement11 I see no SQL Server-specific classes. Only system classes exist. To resolve this issue SQL Server WMI provider needs to be reinstalled.

Step 1 - Install classes

Navigate to C:\Program Files (x86)\Microsoft SQL Server\<SQL Server version, for example "110" for SQL Server 11>\Shared if you have x64 installation of SQL Server. On x86 machine the path is C:\Program Files\Microsoft SQL Server\<SQL Server version, for example "110" for SQL Server 11>\Shared. Make sure that file sqlmgmproviderxpsp2up.mof exists. If it doesn't then either you're in the wrong location or your installation is corrupted and only SQL Server setup can fix the problem. However if the file does exist, then resolution is as simple as running command:

mofcomp sqlmgmproviderxpsp2up.mof

WMI compiler will notify you that repository was successfully updated

Step 2 - Install localization information

After the classes are deployed localization information needs to be installed as well. From the path in the previous step navigate to the sub-folder that reflects the locale of SQL Server installation. For example 1033 (for english-US). Full path is now C:\Program Files (x86)\Microsoft SQL Server\<SQL Server version, for example "110">\Shared\<locale ID, for example "1033" for english>. When at this path run the following command:

mofcomp sqlmgmprovider.mfl

WMI resopitory should have been updated successfully again.

Now you're all set. The problem should be resolve and SQL Server Configuration Manager should be functional again. If it still isn't the I would encourage you to describe your problem at SQL Server Manageability forum - http://social.msdn.microsoft.com/Forums/en-US/sqlkjmanageability/threads

源文档 <http://scottless.com/blog/archive/2010/12/07/sql-server---wmi-error-0x80041010---invalid-class.aspx>

上面的英文主要的意思是说他也遇到了和我相同的问题.导致这个问题的原因是一个文件的问题,这个文件的名字是 sqlmgmproviderxpsp2up.mof ,看着个文件是否存在,如果不存在的话就更新一下,就在运行框运行一下代码

mofcomp sqlmgmproviderxpsp2up.mof

之后WMI将会通知更新成功.但是我按照他的方法去做出现以下错误

clip_image002

第一步没有成功,第二步就更不用去看了,于是再去找其它的方法.

找到了其它网站解决相同的问题,可以确定问题就是出现在 sqlmgmproviderxpsp2up.mof文件上.但是具体的操作不是一样.(加上了路径)

第二种:

SQL Server Configuration Manager – Cannot connect to WMI provider – Invalid class [0x80041010]

When I am trying to connect to my SQL Server 2008 box using SQL Server Configuration Manager today, the following error dialog pops up…

Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager. Invalid class [0x80041010]

clip_image003

I have never seen this before!… while the following line saves me.

>> Open an elevated Command Prompt, and type the following…

mofcomp.exe "C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof"

clip_image004

问题的解决方法和第一种类似,不过更加的具体.然后我就按照他的方式执行.但是还是没有成功(其实自己现在就差一点点了就可以成功了).如下:

clip_image005

由于时间问题昨天晚上没有把这个问题解决了,感觉特别的不舒服,于是自己想着把电脑回宿舍,重新再装一下SQL2008.但是悲剧的是当自己装到十二点安装完成的时候,一运行配置管理,还是相同的问题......于是就睡觉了.(~﹃~)~zZ

晚上做梦貌似都在装数据库...... ╮(╯_╰)╭

今天早早的就起来,到机房想着一定把这个给解决掉.折腾了半个小时还是没有弄好.最后让伟东帮我看一下,提示我是不是路径的问题.一语道破天机.其实路径没有问题,关键是在(x86)果然问题就在这里,按照我自己文件的路径输入之后,更新成功!

如下:

clip_image006

反省和总结

我的错误原因:

1 (x86)不够细心.

原作者的命令是:mofcomp.exe "C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof"

而我的命令是:mofcomp.exe "C:\Program Files \Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof"

关于Windows中32位(x86)和64位(x64)解释 见链接.

2 一些自己并不清楚的文件不要乱删.

收获:

通过此次自己也收获不小是自己第一次尝试用英文来找相关的解决资料,后来再百度一下发现大部分的答案都是从国外翻译过来的,认识到英语的重要性!

posted @ 2011-03-09 21:35  jnqqls  阅读(3028)  评论(1编辑  收藏  举报