views:

615

answers:

2

On a non-production machine, I have two instances of SQL Server 2005. I want to uninstall the second instance, but I have two problems. Although this is a non-production machine, I want to be sure to keep the first instance safe so that I don't have to re-build anything.

I have had the second instance off for a month. When I started instance #2 today, I found that a user database was missing the LDF. I don't need the data in any way.

Also, from previous work done on that server, a separate database was left in mode in recovery. Again, I don't need the data in any way.

My goal is to safely uninstall the second instance. I don't need any of the data in the second instance.

Will the uninstall go smoothly, even though these two databases have issues? If not, what should I do to ensure that the uninstall will go smoothly? Can I safely detach a database that is in recovery? Can I safely detach a database that is missing it's LDF? Are there other steps I should take to ensure that the instance uninstall goes smoothly? Can I simply leave the instance stopped, run the uninstall, and delete the database files afterwards?

A: 

If you want to restore order to things before going ahead with your uninstall, you could fix the database with no log file.

This can be done by first detatching the database with no log file and then subsequently re-attach it, building a new log file by using the system stored procedure

sp_attach_single_file_db

See Books Online: http://msdn.microsoft.com/en-us/library/ms174385.aspx

That said, you should be able to detatch all of your user databases and proceed with an instance specific uninstall, without issue.

John Sansom
+2  A: 

The uninstall should work without any issues. But if your data on instance one is so important as it seems from your question, you shouldn't do anything install/uninstall of any sort without prior having a backup of you system.

jvanderh