2

.ldf file is corrupted so I need to completely rebuild master database on a SQL Express 2008 installation. Is there anything short of destroying the instance completely and starting over?

Kara Marfia
  • 7,892
  • 5
  • 32
  • 56
  • Do you have a backup, yes or no? That'll change the answers you get. If you don't, then the easiest way is to just uninstall, save your mdf/ldf files, and reinstall. Attach them back after the install. – Brent Ozar Jun 02 '09 at 13:16

4 Answers4

1

I'm not understanding why you can't restore the master database from a recent backup. I've done it before with SQL Server 2005. (I must be missing something here.)

How to Restore the master Database

0

The dead silence after the responses that have already been provided tells me that you might not have a backup. If you don't, your only option is rebuild. Have a look here for a post by CSS on rebuilding system databases in SQL 2008.

Aaron Alton
  • 1,118
  • 11
  • 10
0

Evidently when the question got transferred, it is not assigned to the author any more. I don't have a back of master, but I do have backups of the customer data.

I ended up uninstalling SQL Express and re-installing. It left only the customer data in the data folder when I uninstalled, then I used SQLCMD to connect and reattach the database.

  • 1
    rebuild master. your customer data should still be there. You'll have to attach the database though, you can do this in SSMS if you find the .mdf file. You will also need to re-create all the server logins – Nick Kavadias Jun 02 '09 at 15:11
-1

You can reattach databases to a new instance of SQL 2008. Thus preventing you from having to start from scratch.

You could also try installing a new SQL Express instance somewhere else and then copying the master.ldf file from that to your existing instance (while sql is stopped) and then, if needed, reattach the old databases.