KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: 4D for OCI: OCIGetTnsnamesPath and Oracle 10g on Windows
PRODUCT: 4D Oracle | VERSION: 2004.3 | PLATFORM: Win
Published On: February 10, 2006

The 4D for OCI command "OCIGetTnsnamesPath" returns the value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ORACLE_HOME. In Oracle versions prior to 10g this is the correct location to search for the Oracle Home.

However, this is not where the value for the Oracle Home is stored for an Oracle 10g installation. The ORACLE_HOME key in 10g is at:

HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_<install name>\ORACLE_HOME

e.g.:


HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraClient10g_home1\ORACLE_HOME


Thus, when you execute the 4D for OCI command "OCIGetTnsnamesPath" you do not get the correct location of the Oracle Home with Oracle 10g.


As a workaround you can modify the Windows Registry so that the command still works.


WARNING: Do not proceed if you are not comfortable with modifying the Windows Registry.


It is recommended that you make a backup of the Registry before proceeding, or at least export the Oracle Registry keys.


To make the modifications:


1. Open the Microsoft Registry editor

2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE

3. If the String Value for ORACLE_HOME does not exist, create it

4. Modify the String Value "ORACLE_HOME" to point to the same location as:


HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_<install name>\ORACLE_HOME


5. Quit the Microsoft Registry editor


Now the 4D for OCI command OCIGetTnsnamesPath should return the correct Oracle Home for your Oracle installation.