2

我需要从程序中确定服务器上的每个 Oracle Home 中安装了哪个版本的 Oracle。由于 Home 中可能还没有创建任何数据库,因此我需要能够在数据库之外执行此操作(即,无需连接到数据库)。此外,最好能够从远程程序执行此操作。

这是来自运行 .Net(C#,如果重要的话)的 Windows 程序。

我目前正在读取远程注册表项(使用此技术:如何读取远程注册表项?),以根据此方法查找所有 Oracle Homes 。这很好用,但是,我查看了这些键,没有看到有关确切版本/发行版的任何信息。

Oracle Home 本身的名称当然是 1) 不是一个可靠的指标,并且 2) 没有确切的版本/发行版(例如“10.2.0.4.0”)。基本上,我正在寻找一种方法来找出 Oracle Universal Installer 在 Installed Products 按钮中告诉您的内容。

4

3 回答 3

3

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 (i.e. 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 `

于 2016-02-24T18:16:58.063 回答
0

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

    $ORACLE_HOME\OPatch\opatch lsinventory | find "Oracle Database"
于 2020-05-05T16:05:40.637 回答
0

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

于 2016-02-24T20:49:50.293 回答