Reducing the size of your Windows.edb (Search) and DataStore.edb (Update) databases
Posted by jpluimers on 2017/01/30
Windows Search: Windows.edb
If you use Windows Search (I don’t: I use Everything by VoidTools), your Windows.edb can grow ridiculously large. It is a single file, though it appears to be in two places because there is a symbolic link from C:\Users\All Users
to C:\ProgramData
:
C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Windows.edb
C:\Users\All Users\Microsoft\Search\Data\Applications\Windows\Windows.edb
This is how to reduce its size:
How to offline defrag the index
- Change the Windows Search service so that it does not automatically start. To do this, run the following command in cmd.exe:
sc config wsearch start= disabled
- Run the following command to stop the Windows Search service:
net stop wsearch
- Run the following command to perform offline compaction of the Windows.edb file:
esentutl.exe /d %AllUsersProfile%\Microsoft\Search\Data\Applications\Windows\Windows.edb
- Run the following command to change the Windows Search service to delayed start:
sc config wsearch start= delayed-auto
- Run the following command to start the service:
net start wsearch
Notes:
- I did not perform the last 2 steps as I’ve kept Windows Search disabled.
- If you want to reduce the size of the
C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Projects\SystemIndex\Indexer\CiFiles\
directory:- Before step 1, choose what kind of Windows Search indexing options you want
- Between step 3 and 4, delete the directory
Windows Update: DataStore.edb
Windows Update uses the same database structure and is a single file:
C:\Windows\SoftwareDistribution\DataStore\DataStore.edb
This is how I reduced its size:
net stop wuauserv net stop bits esentutl.exe /d C:\Windows\SoftwareDistribution\DataStore\DataStore.edb net start bits net start wuauserv
Talking about Windows Update: you might also want to Clean Up the WinSxS Folder
–jeroen
Logs
Note these are from the “Run as Administrator” command-prompt.
Windows Search database
C:\Windows\system32>sc config wsearch start= disabled [SC] ChangeServiceConfig SUCCESS C:\Windows\system32>net stop wsearch The Windows Search service is stopping. The Windows Search service was stopped successfully. C:\Windows\system32>esentutl.exe /d %AllUsersProfile%\Microsoft\Search\Data\Appl ications\Windows\Windows.edb Extensible Storage Engine Utilities for Microsoft(R) Windows(R) Version 6.1 Copyright (C) Microsoft Corporation. All Rights Reserved. Initiating DEFRAGMENTATION mode... Database: C:\ProgramData\Microsoft\Search\Data\Applications\Windows\ Windows.edb Defragmentation Status (% complete) 0 10 20 30 40 50 60 70 80 90 100 |----|----|----|----|----|----|----|----|----|----| ................................................... Moving 'TEMPDFRG1980.EDB' to 'C:\ProgramData\Microsoft\Search\Data\Applications\ Windows\Windows.edb'... DONE! Note: It is recommended that you immediately perform a full backup of this database. If you restore a backup made before the defragmentation, the database will be rolled back to the state it was in at the time of that backup. Operation completed successfully in 2.625 seconds. C:\Windows\system32>sc config wsearch start= delayed-auto [SC] ChangeServiceConfig SUCCESS C:\Windows\system32>net start wsearch The Windows Search service is starting. The Windows Search service was started successfully.
Windows update database
C:\Windows\system32>net stop wuauserv The Windows Update service is stopping. The Windows Update service was stopped successfully. C:\Windows\system32>net stop bits The Background Intelligent Transfer Service service is stopping.. The Background Intelligent Transfer Service service was stopped successfully. C:\Windows\system32>esentutl.exe /d C:\Windows\SoftwareDistribution\DataStore\Da taStore.edb Extensible Storage Engine Utilities for Microsoft(R) Windows(R) Version 6.1 Copyright (C) Microsoft Corporation. All Rights Reserved. Initiating DEFRAGMENTATION mode... Database: C:\Windows\SoftwareDistribution\DataStore\DataStore.edb Defragmentation Status (% complete) 0 10 20 30 40 50 60 70 80 90 100 |----|----|----|----|----|----|----|----|----|----| ................................................... Moving 'TEMPDFRG3032.EDB' to 'C:\Windows\SoftwareDistribution\DataStore\DataStor e.edb'... DONE! Note: It is recommended that you immediately perform a full backup of this database. If you restore a backup made before the defragmentation, the database will be rolled back to the state it was in at the time of that backup. Operation completed successfully in 8.110 seconds. C:\Windows\system32>net start bits The Background Intelligent Transfer Service service is starting. The Background Intelligent Transfer Service service was started successfully. C:\Windows\system32>net start wuauserv The Windows Update service is starting. The Windows Update service was started successfully.
Leave a Reply