- Published:January 15th, 2009
- Comments:No Comment
- Category:Installers, Lessons Learned the Hard Way, SQL Server 2005
The main purpose of RealCodersCoding is to post about problems we, the authors, have overcome in our daily coding adventures. Sometimes, the problems we are faced with are complex and require some interesting coding yoga to to work out. Other times the solutions are drop-dead simple, but we refuse to recognize them. Here's a little post about how I wasted an entire freakin' day to one of the latter.
I've been coding in the PHP/Joomla/MySQL space for the last 6 months and haven't cracked open my local MS SQL Server 2005 instance lately. When I tried to do so yesterday I was met with this gem--the app wouldn't connect to my local instance. Instead I got some bizarre error message about remote connections. Diving into my Event Viewer to see if there's any clues there, I'm told that the master database is corrupt. The error message helpfully guides me to the Books Online for information on how to rebuild the master database. The easiest solution would be to use a valid backup and just restore it. Ahem! Backup?!? This is my dev machine and I don't do much backing up of anything. I guess I'm stupid that way.
So, I do some research and tried all of the various methods the blog posts and KB articles tell me to try, as in:
- SQL 2005 Rebuild Master And Other System Databases
- Rebuild Master Database in SQL 2005
- Recover the Master Database in SQL Server
All to no avail! So, I'm in a time crunch here. This maintenance work I'm doing should only take a few hours (that's all I'm getting paid for, at least). I decided, screw it, I'll do a reinstall. That'll fix it. That always works, right?
Right off the bat, I know I'm in trouble. I can't completely uninstall SQL Server 2005 via the traditional Add/Remove Programs (ARP). Artifacts are left over including all of the hot fixes and patches that have been applied over time. I follow other blog posts and msdn articles on how to manually uninstall SQL Server 2005, as in:
- How to Uninstall an Instance of SQL Server 2005 Manually
- How to Uninstall MS SQL Server 2005 Manually
There's a ton out there, but they all pretty much say the same thing. The MSDN article did reference a Windows Install Clean Up utility which eventually helped me get rid of the hangers on in ARP. Finally, and we are talking about 2 hours into it, I start installing the new instance. I'm doing this from one of my MSDN DVD's. I navigate the DVD menu and manually run setup.exe from the proper directory (I'm installing the Developer version). The initial install was a snap!
However, I realize (a little later when nothing worked) that I only installed the client tools. No server! No services! No management tools! Arrg! So, I uninstall (again). Clean up after myself and start again. Now, I go a little slower to make sure I make the correct selections in the installer. However, now I'm not given any options for the server components. I go right from the registration screen to the feature selections. I skip the component selections completely. WTF?
My assumption is that there must be some latent artifacts from the previous installation (registry settings, installed services, files, etc.) that make the installer think I still have an instance set up. More blog posts and articles (and hours) and I still can't get the server components installed!
I finally give up and install SQL Server 2000. But that doesn't solve my problem since the DB I need for my maintenance work has been SQL Server 2005-ied and won't open in 2000 any more. :( I swear, cry, go eat dinner and resolve to fight this to the death (of one of us).
Later, I uninstall Visual Studio 2008 (thinking that maybe it's got to be installed after SQL Server 2005). That didn't work (and now I'm faced with the long reinstall [and I'm doing that as I type]). I'm about to tear my hair out (except I don't have any) when I start poking around the DVD directories and stumble across something very interesting: There's a setup.exe in both the Tools directory:
H:\ENGLISH\SQL2005\DEVELOPER\SQL Server x86\Tools\setup.exe
and the Servers directory:
H:\ENGLISH\SQL2005\DEVELOPER\SQL Server x86\Servers\setup.exe
I never once looked in the Servers directory. I just assumed (yeah, yeah, I know) that there's only one setup.exe that I need to deal with.
So the moral to this blog post, if moral there needs to be, is to make sure you know that you are installing the right thing. Otherwise, you'll end up like me - 8 hours into a 3 hour job. And I still have to finish installing VS.NET 2008. If all goes well, I should be done with this work sometime tomorrow.


No Comment
No comments yet.