Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

.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?

share|improve this question
    
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 2 '09 at 13:16

4 Answers 4

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

share|improve this answer
    
Agreed - restoring from backup would be the way to go. You do have backups, right? –  Paul Randal Jun 2 '09 at 4:14

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.

share|improve this answer

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.

share|improve this answer
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 2 '09 at 15:11

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.

share|improve this answer
    
You can not mix and match ldf files. You will get an LSN error. –  gbn Jun 2 '09 at 4:22
    
Downvoted as your advice of copying the old .ldf file isn't possible. –  Paul Randal Jun 2 '09 at 4:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.