I need to determine from a program what version of Oracle is installed in each of the Oracle Homes on a server. As there may not be any databases created in the Home yet, I need to be able to do this outside of the database (i.e., without connecting to the database). Also, it would be highly preferable to be able to do this from a remote program.
This is from a windows program running .Net (C#, if that matters).
I am currently reading remote registry keys (using this technique: https://stackoverflow.com/questions/1566547/how-to-read-remote-registry-keys), to find all of the Oracle Homes according to this method. This works fine, however, I have looked around those keys and do not see any information on the exact version/release.
The name of an Oracle Home itself is of course 1) not a reliable indicator and 2) does not have the exact version/release (for instance "10.2.0.4.0"). Basically I am looking for a way to figure out what the Oracle Universal Installer tells you in the Installed Products button.
I should clarify, all of the Servers will be running Windows 2003-2008.
Best Answer
If the database homes were installed properly, the central inventory has a list about them. The central inventory on Windows is located at
C:\Program Files\Oracle\Inventory
. On Linux/UNIX platforms, the location of the central inventory can be found in/etc/oraInst.loc
. In the inventory, inContentsXML\inventory.xml
, there is a list of installed homes in XML format, e.g:You can parse this list, and find detailed information with opatch for example:
A Windows example would be:
The above needs to be run on the server of course.
This is the best-case scenario, with proper installations. Worst-case scenario is, homes use separate inventories, or use no inventory at all, and you have to search all filesystems on the server for possible Oracle installations.