It has been some time since I have ran into this issue; however yesterday brought back some old memories of my early years as a developer and then DBA – orphaned instances. Currently, I run 3 SQL instances on my machine. I kept SQL Server 2008 R2 installed as well as SQL Server 2012 as I have some needs for both that I won’t necessarily go into in this post.
I had some instance name issues that I had to work through when I installed 2012 on my machine that I knew I was going to have to go back and clean up at a later time. Well, that time came yesterday. As I uninstalled 2008 R2, I must have performed a misstep and in essence ended up with two orphaned instances on my box. Most people would not be thrilled with this scenario however I was pretty stoked as I knew that I could use this to brush up on how to get rid of them.
I wanted to have a fresh install of 2012 only on my machine so I uninstalled 2012 and then it was time to deal with my orphaned instances.
Before I share this I want to iterate that this is how “I” handled this situation and it requires manual intervention. I re-tested this out on another box as well just to provide a second test. I would not recommend doing anything on a prod environment until you test it out; no matter what blog or article you get your information from. One, it helps you to understand what you are doing and two provides security in that you can perform the tasks.
Okay so below are my steps I took to manually remove my orphaned instances:
- Click on the Start menu, choose Run and type in Regedit (nervous yet?)
- Go to HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server
- Remove all sub-directories and Instance name folder
- Delete the folder from % Program Files%\Microsoft SQL Server\%name%
Once completed I like to do a fresh reboot; then when you perform your installation the old orphaned instances are no longer available.
I did not share my instance names as they may vary across the board but this is a quick way to manually clean up orphaned instances. I do implore you to use extreme caution when dealing with Regedit. If you do not know what you are doing you can do some major damage to your box.