简体   繁体   中英

programmatically determine Oracle Home installed version?

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 (ie, 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: How to Read Remote Registry Keys? ), to find all of the Oracle Homes according tothis 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.

Search for file oci.dll in PATH , this is one of the major files of an Oracle Client installation. You can read version of this file with FileVersionInfo.GetVersionInfo("oci.dll");

In order the get the Registry Hive, search for file oracle.reg in PATH (ie Oracle Home). This file is a simple text file containing the Registry key, for example SOFTWARE\\ORACLE\\KEY_OraClient11g_home1 . You will find related registry values in HK_LOCAL_MACHINE\\SOFTWARE\\ORACLE\\KEY_OraClient11g_home1 `

我不准确,但我认为您应该尝试查看v$parameter系统视图。

您可以转到注册表中给出的 oracle 主路径,如果主目录在 Windows 中,请尝试在命令提示符下执行以下命令

    $ORACLE_HOME\OPatch\opatch lsinventory | find "Oracle Database"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM