WSUS database corruption
The following tip was submitted by reader Quentin Gurney who is an enterprise IT architect currently working for a Fortune 100 company:
Windows updates not installing due to local computer WSUS database corruption
Perhaps you have run into this issue. You cannot install Windows updates and there is an error in the application log that suggests there is something wrong with the database.
Error code requiring this fix:
Log Name: Application
Date: 6/18/2009 3:22:06 AM
Event ID: 474
Task Category: Database Page Cache
wuaueng.dll (340) SUS20ClientDataStore: The database page read from the file "C:\Windows\SoftwareDistribution\DataStore\DataStore.edb" at offset 4595712 (0x0000000000462000) (database page 1121 (0x461)) for 4096 (0x00001000) bytes failed verification due to a page checksum mismatch. The expected checksum was 2818733426791738953 (0x271e271e0c70ee49) and the actual checksum was 1089324781602401865 (0x0f1e0f1e0c70ee49). The read operation will fail with error -1018 (0xfffffc06). If this condition persists then please restore the database from a previous backup. This problem is likely due to faulty hardware. Please contact your hardware vendor for further assistance diagnosing the problem.
There indeed is something wrong with the database, but how do you fix a windows internal database for WSUS? There is not much documentation on the subject and what there is suggests you might need to rebuild the whole O/S to make it work. When I ran across this, I was not very interested in doing that kind of a rebuild so I did some more digging.
I found some information that suggested that the local machine WSUS DB might be the same DB that Active directory uses or Exchange uses. To fix that kind of dB, I found this entry suggesting I needed to use esentutl.exe which on a DC is front ended by ntdsutil:
Found this KB and got the idea to try repairing the JET DB:
- First, got on a Domain Controller because the tool I needed was installed there.
- Mapped c: drive on problem server as z:
- On the problem server box shut down cryptographic service, BITS, Windows Updates. (I had to set windows updates to disabled – kept restarting and opening the file)
- Executed following command:
C:\Users\my account>esentutl /p z:\windows\softwaredistribution\datastore\datastore.edb
Extensible Storage Engine Utilities for Microsoft(R) Windows(R)
Copyright (C) Microsoft Corporation. All Rights Reserved.
Initiating REPAIR mode...
Temp. Database: TEMPREPAIR1264.EDB
Checking database integrity.
Scanning Status (% complete)
0 10 20 30 40 50 60 70 80 90 100
Integrity check successful.
It is recommended that you immediately perform a full backup
of this database. If you restore a backup made before the
repair, the database will be rolled back to the state
it was in at the time of that backup.
Operation completed successfully in 61.75 seconds.
After that, restarted services and we are now installing windows updates. This saved me a few hours by avoiding a rebuild. Server is working fine.
The above tip was previously published in an issue of WServerNews, a weekly newsletter from TechGenix that focuses on the administration, management and security of the Windows Server platform in particular and cloud solutions in general. Subscribe to WServerNews today by going to http://www.wservernews.com/subscribe.htm and join almost 100,000 other IT professionals around the world who read our newsletter!
Mitch Tulloch is an eleven-time recipient of the Microsoft Most Valuable Professional (MVP) award and a widely recognized expert on Windows Server and cloud computing technologies. Mitch is also Senior Editor of WServerNews. For more information about him see http://www.mtit.com.