首页 新闻 会员 周边

安装sqlserver出现wmi无法启动

1
悬赏园豆:20 [已解决问题] 解决于 2012-05-10 15:56
WmiServiceStateCheck 检查 WMI 服务是否已在计算机上启动并正在运行。 失败 无法启动 Windows Management Instrumentation (WMI)服务。若要继续安装,必须找到问题并修复 Windows Management Instrumentation (WMI)服务。

 错误如上

 可以正常停止和启动、包括重新启动 都是正常的  重置  

 

 

google了下

第一种办法:

执行下边的脚本无用:

@echo on 
cd /d c:\temp
if not exist %windir%\system32\wbem goto TryInstall
cd /d %windir%\system32\wbem
net stop winmgmt
winmgmt /kill
if exist Rep_bak rd Rep_bak /s /q
rename Repository Rep_bak
for %%i in (*.dll) do RegSvr32 -s %%i
for %%i in (*.exe) do call :FixSrv %%i
for %%i in (*.mof,*.mfl) do Mofcomp %%i
net start winmgmt
goto End

:FixSrv
if /I (%1) == (wbemcntl.exe) goto SkipSrv
if /I (%1) == (wbemtest.exe) goto SkipSrv
if /I (%1) == (mofcomp.exe) goto SkipSrv
%1 /RegServer

:SkipSrv
goto End

:TryInstall
if not exist wmicore.exe goto End
wmicore /s
net start winmgmt
:End

没有报错

 

第二种办法:用这里的办法也没用

http://social.technet.microsoft.com/Forums/en-US/itprovistasetup/thread/11d6d64e-543b-40cd-a0f6-ba97c3806fbb/

1) Start the computer and press F8 on boot up and select Safe Mode.
2) In the start menu type "cmd" (without quotes) and on the top search result, right click the program icon and choose Run as administrator
3) Type "net stop winmgmt" (without quotes) and press Enter to make certain the WindowsManagementInstrumentation (WMI) service is not running.
4) Open a Windows Explorer and locate the path to C:\ windows\system32\WBEM\ folder and rename the Repository folder to something else like RepositoryOLD (right click and choose 'Rename Folder').
5) Reboot and restart as normal.
6) In the start menu type "cmd" (without quotes) and on the top search result, right click the icon and choose Run as administrator
7) Type "net stop winmgmt" (without quotes) and press enter to stop the WMI service.
8) Type "winmgmt /resetRepository" (without quotes) and restart the computer.



每一步都提示成功的 最后一步是 重置成功  然后重启计算机  运行sql安装程序还是这个错误

 

第三种办法:
参考:https://connect.microsoft.com/SQLServer/feedback/details/682543/wmi-service-cannot-be-started-when-installing-sql-server-denali-ctp3

 

 

SELECT NAME FROM WIN32_SERVICE WHERE NAME = 'winmgmt'

Win32_Service.Name='winmgmt'

 

跟这位的错误时一样的 包括 运行powershell   

PS C:\Windows\System32\wbem> get-wmiobject -Query "SELECT NAME FROM WIN32_SERVICE WHERE NAME = 'winmgmt'"
Get-WmiObject : 未将对象引用设置到对象的实例。
所在位置 行:1 字符: 14
+ get-wmiobject <<<< -Query "SELECT NAME FROM WIN32_SERVICE WHERE NAME = 'winmgmt'"
+ CategoryInfo : NotSpecified: (:) [Get-WmiObject], NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.GetWmiObjectCommand




我运代码 2.0  3.5  4.0 都是正确的下边的代码:

using System;
using System.Management;

public class Sample
{
public static void Main()
{
ManagementClass c = new ManagementClass("Win32_Process");
foreach (ManagementObject o in c.GetInstances())
Console.WriteLine(
"Next instance of Win32_Process : {0}", o["Name"]);

Console.ReadKey();

}
}


输出没有异常

-------------看那位后边似乎是重装系统搞定的

 

 

高手给看看看

一个土豆一棵青菜的主页 一个土豆一棵青菜 | 菜鸟二级 | 园豆:268
提问于:2012-04-09 22:05
< >
分享
最佳答案
0

早几年我在xp下遇到过这个问题,一直没解决。建议你不要纠缠在这种问题上了。

收获园豆:10
丁码农 | 菜鸟二级 |园豆:437 | 2012-05-06 23:52
其他回答(1)
1

看一下%userprofile%\APPDATA\LOCAL\TEMP中,有没有WMIDIAG开头的.log文件

收获园豆:10
dudu | 园豆:30979 (高人七级) | 2012-04-10 13:28

没有啊

临时文件夹只有 sqltep.log

 

 

详细报表:

Microsoft SQL Server 2008 Setup - System Configuration Check Report

Computer Name(s): GAONAN-PC 
Report Date/Time: 2012/4/12 0:52
Saved to Directory: C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20120412_005153\SystemConfigurationCheck_Report.htm

Rule NameRule DescriptionResultMessage/Corrective Action
GlobalRules: 针对规则组“GlobalRules”的 SQL Server 2008 安装程序配置检查
WmiServiceStateCheck 检查 WMI 服务是否已在计算机上启动并正在运行。 失败 无法启动 Windows Management Instrumentation (WMI)服务。若要继续安装,必须找到问题并修复 Windows Management Instrumentation (WMI)服务。
AclPermissionsFacet 检查 SQL Server 注册表项是否一致。 通过 SQL Server 注册表项是一致的,可以支持 SQL Server 安装或升级。
MediaPathLength 检查 SQL Server 安装媒体是否太长。 通过 SQL Server 安装媒体不太长。
OsVersionCheck 检查计算机是否满足最低操作系统版本要求。 通过 该操作系统版本满足此产品的最低要求。
RebootRequiredCheck 检查是否需要挂起计算机重新启动。挂起重新启动会导致安装程序失败。 通过 不需要重新启动计算机。
ThreadHasAdminPrivilegeCheck 检查运行 SQL Server 安装程序的帐户是否具有计算机的管理员权限。 通过 运行 SQL Server 安装程序的帐户具有计算机的管理员权限。

Rules Documentation: http://go.microsoft.com/fwlink/?LinkId=94001 
Community: http://msdn2.microsoft.com/en-us/sql/aa336317.aspx 
Setup Help File: http://msdn2.microsoft.com/en-us/library/bb500469(SQL.100).aspx

支持(0) 反对(0) 一个土豆一棵青菜 | 园豆:268 (菜鸟二级) | 2012-04-12 00:54

C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20120412_005153\Detail_GlobalRules.txt

这里有关wmi的错误

 

2012-04-12 00:52:08 Slp: Initializing rule      : Windows Management Instrumentation (WMI)服务
2012-04-12 00:52:08 Slp: Rule applied features  : ALL
2012-04-12 00:52:08 Slp: Rule is will be executed  : True
2012-04-12 00:52:08 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.WmiServiceInfo
2012-04-12 00:52:08 Slp: 未将对象引用设置到对象的实例。
2012-04-12 00:52:08 Slp:    在 System.Management.SecuredConnectHandler.ConnectNSecureIWbemServices(String path, IWbemServices& pServices)
   在 System.Management.ManagementScope.InitializeGuts(Object o)
   在 System.Management.ManagementScope.Initialize()
   在 System.Management.ManagementObjectSearcher.Initialize()
   在 System.Management.ManagementObjectSearcher.Get()
   在 
支持(0) 反对(0) 一个土豆一棵青菜 | 园豆:268 (菜鸟二级) | 2012-04-12 00:58
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册