Return to Index

#0000000

Problem connecting Microsoft Oracle ODBC driver on Windows 2000 Server to remote Oracle database

Be aware that editing your registry can potentially damage your OS installation, and make Windows unbootable. Only attempt editing the registry if you are and experienced user, have made current backups of your system, and are knowledgeable in how to perform registry modifications. You agree that we will not be considered responsible should your use of these instructions result in failure or damage to your computer or Operating System.
The Problem:
Trying to migrate IIS services from one Windows 2000 Server to a new Windows 2000 Server. All relevant components were running at identical versioning.
The existing W2KS system was using the Microsoft Oracle ODBC driver to establish a DSNless connection between ASP pages under IIS. (although it turns out that the DSNless component was not relevant to this situation).
The local administrator had already tried repeated installs of the Oracle 8i Client environment on the new server in order to get the connection working, and this had failed causing IIS to generate the error:
          Microsoft OLE DB Provider for ODBC Drivers error '80004005'
          [Microsoft][ODBC driver for Oracle][Oracle]
...when trying to establish a database connection from the ASP pages.
My Solution:
When I came in, the client was currently uninstalled from the server.
I began by first performing a complete install of the Oracle 8i Client, up to the point where it asks for post installation configuration information. At that point I exited the install and ran the "Net8 Assistant" on both servers so that I could match configuration from a similar interface.
Next, in the "Net8 Assistant" control panel, I configured all of the entries in the groups: Net8 Configuration->Local->Service Naming->_______
After each entry was added, I successfully performed the test function. When I had finished adding all entries, I exited the application, and examined the " tnsnames.ora " that the client generated. Next I copied the " sqlnet.ora " file from the old server.
Then I ran both the TNSPING and SQLPLUSW test programs to determine if I had a working connection. These tools both worked correctly.
Unfortunately, IIS was still generating the same error as before. After a few days of searching and comparing every component of the two servers to insure parity of the systems... and on a hunch, I decided to compare system configuration between the two machines at a Registry level.
On the first server, I noticed that all of the Oracle Registry entries were in place for only a single HOME0 entry, and all default configuration pointed to the settings of that HOME0 entry.
On the new server, there were six (6) HOME entries in the registry, but all of the "default" entries pointed to HOME0, whereas my working connection was under HOME5. Since this was the only difference I had been able to find between the two systems to date, I decided to modify the registry on the new server so that it would match the old server.
These were my critical Registry entries, and how they ended up looking when I was complete:
          [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE]
          ORACLE_HOME       = c:\oracle\ora81
          ORACLE_HOME_NAME  = OraHome81
          ORACLE_GROUP_NAME = Oracle - OraHome81

          [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES]
          HOME_COUNTER      = 1
          DEFAULT_HOME      = OraHome81
          LAST_HOME         = 0

          [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES\ID0]
          NAME              = OraHome81
          PATH              = c:\oracle\ora81

          [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0]
          ID                = 0
          ORACLE_GROUP_NAME = Oracle - OraHome81
          ORACLE_HOME_NAME  = OraHome81
          ORACLE_HOME       = c:\oracle\ora81
          ORACLE_HOME_KEY   = Software\ORACLE\HOME0
Once I had deleted all of the other entries from the registry (HOME0, HOME1, HOME2, HOME3, & HOME4), I renamed HOME5 to HOME0, and modified it's contents to reflect the change from "5" to "0". I also had to modify:
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE],
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES], &
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES\ID0]
...for their contents to reflect the new Oracle Home naming and path information changes.
Once these changes were made, the ASP pages under IIS suddenly started connecting to the Oracle server!
My only conclusion here is that the Microsoft Oracle ODBC driver *ONLY* looks to the "default" entries under the Oracle registry keys... Additionally, I have a suspicion that the driver might only look at the HOME0 data, but I don't know for sure.

My suggestion, is that if you are:

1) having problems getting the Microsoft Oracle ODBC driver working,

2) you have exhausted all other possible configuration issues, and

3) you have all of the Oracle tools making a proper connection... then, and only then, check the Oracle registry entries for incorrect configuration data, and be sure to perform complete back-ups first before you change anything, so that you can revert back if necessary!

...follow-up... five days later...

Mysteriously the server worked great for a couple of days and then poof the error started happening again, only now, even the Oracle tools were failing as well and we were now getting an error of " ORA-12538 ".

So, on a lark, of all things, we added a "SET" environment variable from the W2K environment settings for:
SET ORACLE_HOME = c:\oracle\ora81

...and poof! It's working again?!?! Why did it work before? Why is it working now? Grrr...

Be aware that editing your registry can potentially damage your OS installation, and make Windows unbootable. Only attempt editing the registry if you are and experienced user, have made current backups of your system, and are knowledgeable in how to perform registry modifications. You agree that we will not be considered responsible should your use of these instructions result in failure or damage to your computer or Operating System.