During the Package Refresh process codebases are unable to be created for various Patch Management related software updates as the files are no longer physically present on the Notification Server.
Unable to refresh the codebase information for package: 'install_flash_player_18_plugin.exe' (36f01079-be58-9694-6b16-0f91093b3688)
Could not access the package path. Package: 'install_flash_player_18_plugin.exe' (36f01079-be58-9694-6b16-0f91093b3688), Path: D:\Patch Management\Packages\Updates\APSB15-16\{32812b6d-68f1-42dc-9d2a-00430933bc9e}
ITMS 8.x
In this case there were ~1,000 Patch packages that no longer have the binaries downloaded (they really aren't needed) and the 'Check Software Update Package Integrity' task did not remove these packages from the CMDB.
Assuming that Package Refresh has done all that it can do and there are Patch packages that it cannot build then the following SQL should do it. PLEASE ENSURE YOU HAVE A RECENT BACKUP OF THE SYMANTEC_CMDB!
The SQL will do the following:
insert into ItemToDelete (Guid,DeleteDate)
select distinct p.Guid, GETDATE()
from vRM_Package_Item p
left join ItemToDelete d on d.Guid = p.Guid
left join SWDPackageCodebase cb on cb.PackageId = p.Guid
and cb.[Source] is NULL
where p.ProductGuid = 'B1338338-5575-4A27-9808-23BEC40D79FA'
and cb.PackageId is null
and d.Guid is null