Search

Monday, December 30, 2013

The SQL Server System Configuration Checker cannot be executed due to WMI configuration on the machine DI-ERP2 Error:2148007941 (0x80080005).

Today when I was trying to uninstall SQL Server If got below error:

TITLE: Microsoft SQL Server 2005 Setup
------------------------------
The SQL Server System Configuration Checker cannot be executed due to WMI configuration on the machine MAIN Error:2148007941 (0x80080005). 

Than I searched the net and found below command file and I ran this and it fixed my WMI problem. Copy below content into notepad as save in C Drive root as fixwmi.cmd and then from a command line run c:\fixwmi.cmd.

It takes several minutes to complete and at points it appears that it is not running but it is. After it is complete, my problem is solved.

The content of cmd file is:

@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

Monday, December 23, 2013

SQL Backup job failed with exitcode: 880 SQL error code: 942 [SQLSTATE 42000] (Error 50000). The step failed.

When a database is offline and you try to take backup of that database than below error will show:

SQL Backup job failed with exitcode: 880 SQL error code: 942 [SQLSTATE 42000] (Error 50000). The step failed.

So, before running backup on any database, check whether the database is online.
Now to make database online, you can use below methods:

Method 1

use master
go
Alter Database <Database_Name> SET Online

Method 2

Open SSMS, select database, right click. Select Tasks and Select Bring Online.

Monday, December 16, 2013

Deleted all login from SQL Server and now unable to Login to SQL Server

Mistakenly I had deleted all logins from SQL Server and now unable to login to SQL Server. When I try to login I got below error.

Login failed for user '  domain\name'. (Microsoft SQL Server, Error: 18456)

To resolve the issues I follow below steps:

Click START - Run - cmd (Command Prompt)

Stop the sql server : NET STOP MSSQLSERVER

Now Start the sql server with single user mode from command prompt:

NET START MSSQLSERVER /m

Connect the SQL Server using the Windows Authentication. To find out the windows server name

  •      click start
  •      Right click on my computer
  •      Select properties
  •      computer name
If above steps are not working, connect SSMS with windows Authentication.

Create login and provide sysadmin rights.

Stop the sql server running the below command in command prompt.

NET STOP MSSQLSERVER

Start the sql server with multi user mode running the below command in command prompt

NET START MSSQLSERVER

Monday, December 2, 2013

Database Stuck In Restoring State

Sometime, You may found a database that is restoring mode after so many hours and after refresh also, the database is still restoring.

This usually occurs when a user who initiated the restore, was disconnected during the restore process and leaves the restore process. 
OR
The User  forget to include WITH RECOVERY with Restore script.

Solution:
Run RESTORE DATABASE [Database_Name] WITH RECOVERY  to complete roll forward. 
If this failed, than you may have to drop the database and restoring from backup 
(make sure you include RECOVERY in your restore script this time).