Thursday 7 April 2011

Broken WMI on SQL Server after restore

Issue

Virtual SQL Server was restored after DR scenario recently.  Databases were recovered and SQL Server up and running.

When attempting to start SQL Server Configuration Manager, the following error was generated:
Cannot connect to WMI provider.  You do not have permission or the server is unreachable.  Note that you can only manage SQL Server 2005 servers with SQL Server Configuration Manager.  Invalid Namespace [0x8004100e]

Similarly, in Surface Area configuration when attempting to 'configure surface area for localhost', the following error was generated:
Computer localhost does not exist on the network, or the computer cannot be configured remotely.  Verify that the remote computer has the required Windows management Intrumentation components and then try again. (SQLSAC)
Additional Information: SQL Server WMI provider is not available on localhost. (Microsoft.SqlServer.Smo)
Invalid Namespace (System.Management)

Fix

Our WinTel engineer fixed the issue, links below:

Repairing and re-registering the WMI Services
Rebuilding the WMI Repository
If you experience behavior when using WMI, such as application errors or scripts that used to work are no longer working, you may have a corrupted WMI repository. To fix a corrupted WMI repository, you have to reinstall WMI. Follow these steps:
  • Click Start, Run and type CMD
  • Type this command and press Enter:
net stop winmgmt
  • Using Windows Explorer, navigate to %systemroot%\system32\wbem directory and delete the Repository directory. By default, the repository folder is located in the C:\Windows\system32\wbem directory.
  • Switch to Command Prompt window, and type:
net start winmgmt
Re-registering the WMI components
The .DLL and .EXE files used by WMI are located in %windir%\system32\wbem. You might need to re-register all the .DLL and .EXE files in this directory. If you are running a 64-bit system you might also need to check for .DLLs and .EXE files in %windir%\sysWOW64\wbem.
To re-register the WMI components, run the following commands at the command prompt:
cd /d %windir%\system32\wbem
for %i in (*.dll) do RegSvr32 -s %i
for %i in (*.exe) do %i /RegServer

1 comment: