Sql-server – Recreate MSDB for SQL Server Express 2008

sql serversql-server-2008

My SQL Server Express database's msdb file has become 'suspect'. All the other mdf files seem to be OK.

I now need to recreate the msdb file, but I do not have a backup for it (guilty as charged!). I have backups for my other DBs. This is what I found from this blog:

If your msdb goes suspect then you have two choices, if you have
backup of database then restore it else you have to recreate it

If you want to recreate it here are the steps to do it

  1. Start the server with trace flag 3608. Detach the damaged msdb
  2. Navigate to the directory C:\Program Files\Microsoft SQL
    Server\MSSQL.1\MSSQL\Binn
    and start sqlservr.exe -c -T3608
  3. Move or rename the damaged msdb files
  4. Go to the folder C:\Program Files\Microsoft SQL
    Server\MSSQL.1\MSSQL\Install
    and run the instmsdb file.
  5. Restart SQL Server without the 3608 trace flag

Has someone done this before? I would like to get opinions or better suggestions before I break things more.

Thanks!

EDIT:
My advice to anyone is to treat SQL Express like any production DB. Have rigorous back-up policy and make sure you back-up your system databases.

Best Answer

You either recreate as above or restore it.

The info above is similar to MSDN, see "Creating a New msdb Database".

Note: if this came from Paul Randal's blog or the SQL Server Storage Engine then you can trust it