Error:
Database ‘msdb’ cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server error log for more information.
Error Message:
Causes:
The main cause of the above error message is that the SQL database has been marked suspected. This situation occurs under following conditions:
- When the ldf file does not match with the mdf file.
- Database might be corrupted.
- Database ‘msdb’ cannot be opened due to insufficient permission or inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.
- User does not have permission to alter database ‘msdb’, the database does not exist, or the database is not in a state that allows access checks.
Workaround 1:
If MSDB data base is found corrupt, we can replace it from backup.
For example
MSDB mdf and ldf files will be located in DATA folder of SQL, we can find backup in template data folder.
Note :- Perform this workaround if you are sure about the exact location of the msdb data base & before replacing it from backup rename the corrupted file.
Workaround 2:
Remove Microsoft SQL Server 2005 completely from Control panel
Control Panel | Add or Remove Programs | Microsoft SQL Server 2005
In the first dialog, make sure to select the “RELYONDB: Database Engine” radio button.
If RELYONDB is the only instance, then select all check boxes & Click Next and Finish to proceed with the uninstall.
If there is no other SQL instance, I would go on to clean out all SQL components with the following steps.
Uninstall Microsoft SQL Server Native client
Uninstall Microsoft SQL Server Setup support files
Uninstall Microsoft SQL Server VSS writer
Re-install SQL Server 2005 RELYONDB and attach the data files from application.