Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to determine Oracle 10g Home programatically?

205783Dec 20 2005 — edited Jan 12 2006
With the Oracle 9i client, I was able to figure out (in a program or install script) where the Oracle 9i home folder was by looking at the registry key /HKEY_LOCAL_MACHINE/Software/Oracle/Oracle_Home. However, I don't see anything like this for the Oracle 10g client. I see a branch entitled KEY_OraClient10g_home but I don't think that is consistant across all Oracle 10g client installs (i.e. I think I entered the name OraClient10g_home when I installed the client).

So... is there a way (programatically) to determine what the 10g home folder is? Thanks.

Tom

Comments

Paul M.

If you use Enterprise Manager you should have a SYSMAN schema. If so, try

SQL> select distinct oracle_home from sysman.EM$ECM_TARGETS_VIEW;

ORACLE_HOME
--------------------------------------------------------------------------------
/home/oracle/OraHome1

SQL>                                                                            
205783
Paul: Thanks but this isn't going to be able to help me. What I need to be able to do is to get this information before I have a connection to the database; i.e. I need to get the 10g home from Windows Installer or Wise for Windows Installer. This, of course, means I need to get it from the registry or from some other means that does not involve accessing the database itself.

Tom
Paul M.
Sorry, I misunderstood "programatically". Unfortunately at the moment I don't have on hands a Windows machine with 10g. Maybe others....
orafad
What if you have more than one "10g" product?

The registry keys for newer installs on Windows are named KEY_<ORACLE_HOME_NAME> e.g. KEY_OraiStudio_1
Top/home folder is found in the value ORACLE_HOME of this key.
482476
I just checked a fresh install of 10gR2, and a hybrid we have that is running 9iR2 with a 10g client in place. If you are looking for 10g home information, you will want to enumerate keynames under the HKLM/Software/Oracle key. You are looking for keys that begin with KEY_. These are likely Oracle homes.

While it is true that you can name your Oracle home what you want to, Oracle seems to prefix KEY_ to its home names the way 9i would create keys named HOMEX to describe the homes. Underneath the KEY_ key you will find the values ORACLE_HOME, ORACLE_HOME_KEY, and ORACLE_HOME_NAME that will give you all the information about the home that you might need.

While this means you have to write a loop to check for potential homes and a test to check for the value name you want to use, it should probably work. Worst case scenario is that you write a loop to iterate through the child keys under HKLM/Software/Oracle and check to see whether each key has the value ORACLE_HOME. Oracle names that value and sets its value, so you should always find it.
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 9 2006
Added on Dec 20 2005
5 comments
9,624 views