Sunday, June 19, 2011

Fatal Error : Failed object initialization when Installing AdventureWorks2008R2 Sample Databases

I recently installed AdventureWorks 2008R2 SR1 as a sample database in my SQL Server 2008 R2 to test SharePoint 2010 Enterprise Search with custom databases.While installing the AdventureWorks 2008R2 SR1 I faced some issues and I thought to share those issues and ways to solve those issues with you all.

First you can download AdventureWorks 2008R2 SR1 for free from the following link.
    Download  AdventureWorks 2008R2 SR1

After you have finished downloading, there will be a single self extracting zip file which contains all of the AdventureWorks sample databases for SQL Server 2008R2. When this zip file is run, all content is unzipped to a temporary directory and an installer application is automatically started. This application copies the database scripts and data files to the directory specified, and optionally installs sample databases. If some databases cannot be installed, a brief explanation is displayed and a link is provided for more information about how to resolve the installation issues.

This is what you will get when you ran the self extracting zip file.



Then I ticked that I accept the licence terms and clicked Next hoping that installation will go smoothly. Then the following Error appeared.


It says,

A fatal error occurred during installation. Details:

Failed object initialization (ISupportInitialize.EndInit).An exception occured in SMO while trying to manage a service. Error at object 'DatabaseSelection' in markup file 'DatabaseInstaller;component/databaseselection.xaml' Line 78 Position 3.


First I was little bit surprised. Then I started to troubleshoot the error. First what I did was check the Installation Guide for installing AdventureWorks 2008R2 SR1.

In that there were three main steps to follow. They were,
  1. Installing Full-Text Search.
  2. Enabling the SQL Full-text Filter Daemon Launcher Service.
  3. Enabling FILESTREAM,
I was pretty sure, I have enabled all features with Full-Text Search when I was installing SQL Server 2008 R2. But I wasn't sure about the other two. So after reading the Installation guide I went for Enabling the SQL Full-text Filter Daemon Launcher Service. And for that I needed to go to SQL Server Configuration Manager. I followed StartAll Programs, then Microsoft SQL Server 2008, then Configuration Tools, and then clicked on SQL Server Configuration Manager. And when I clicked on it I was astonished. I got another error.


It says,

Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager. Invalid class [0x80041010]

Again I am pretty sure that I do have the permission and I am running on SQL Server 2008 R2. Then I Googled for this error and I found out the reason. Microsoft has provided you the full explanation of this error and answer in this link. After reading Microsoft's solution, in an elevated Command Prompt, I typed the following.

mofcomp.exe "C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof"

Then I navigated to SQL Server Configuration Manager and clicked on it. Now there was no error and successfully managed to open Configuration Manager. Now according to AdventureWorks 2008R2 SR1 Installation Guide, enabled the SQL Full-text Filter Daemon Launcher Service and fixed it's Start Mode to Automatic.

Then enabled the FILESTREAM by opening the SQL Server Management Studio (SSMS), and in the query window, running the below code,

EXEC sp_configure filestream_access_level, 1
RECONFIGURE

Now everything was good to go. Again I ran the self extracting zip file of AdventureWorks 2008R2 SR1. Finished extracting files and installer application automatically started. Again ticked that I accept the licence terms and clicked Next. Now there was no fatal error and AdventureWorks 2008R2 SR1 sample databases were ready for installation.

Hope someone gets needed help from this post. Appreciate your feedback.

Happy Coding.

Regards,
Jaliya