How to automatically repair the Spectrum Archive Manager DDM database