Tuesday 25 September 2012

SQL Server Installation error due to WMI Services

Today I had a chance to work on a SQL Server Installation failure due to WMI services cannot be started. It was really interesting to work with, So thought of sharing it. 

Error




Reason
The WMI Services on the sevices.msc shows that it is running, when we right clicked on Windows Management Instrumentation services-->Dependencies I have got the error as "WMI: Initialization Failure". It shows clearly that WMI have got corrupted.
 
Possible Fix
Since the WMI has got corrupted, we can try reinstalling the WMI components. Let us see how we can do that.


Step-1
Copy the following command in a notepad and save it as "REINSTALL_WMI.bat"

@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

Step-2

Execute the script, while it is getting executed it will show the dependent services for the WMI services and it prompts whether to continue with the Reinstallation operation or not. Proceed with Y if you want to continue.




Once the operation completes the command window closes automatically. Reboot the server and tried with the SQL Server installation and it worked!!! SQL Server Installation went on well and handed over the system to the user.



Reference
There is a blog Post in MSDN Forum which was really helpfull to work with this issue.
 


Thursday 6 September 2012

Consistency error due to differential bitmap out-of-sync


Today while working on the backup check I have noticed the checkdb step has got failed in the fullbackup job. I would like to know the reason why it has got failed, so started checking it and the history showed the hint as like data modified is not marked as modified in the differential backup bitmap.

So running the DBCC CHECKDB('RapidApplication_Test') with Physical_only gave me a result as shown below.


The detailed cause of this error is shown below


 

Cause of the error


We will just have a look at the background, differential bitmaps are used to keep track of which extents have been modified since the last full backup. A differential backup contains all those pages changed since the last full backup.

The page specified has a log sequence number (LSN) that is higher than the differential reference LSN in the BackupManager of the database or the differential base LSN in the file control block of the file, whichever is more recent. However, the page is not marked as changed in the differential backup bitmap.

It can be due to Hardware Failure, I/O error etc... In my cause that day the storage & wintel team was doing some change related to the hardware so that could be the reason for it.

Fix


Since the error gave me a hint about differential bitmap out-of-sync and also there was no other error reported in Checkdb so just taken the Fullbackup by thinking this will reset the differntial bitmap flag. Backup completed Successfully and thought of checking the result of of checkdb, Kudos!! got a clean result.

Target attained then started looking for the next task to work on.