3

How can I check all oracle versions and platforms that installed on windows machine from a command line or byscript ? Till now I was using tnsping and check for the output but it only show the first version according to the path environment variable. Is there a way to get this info from the registry and without actually connect to DB ?

Epligam
  • 741
  • 2
  • 14
  • 36

3 Answers3

5

Simplest method is to run command prompt and type sqlplus it will show you the oracle version without actually logging into it.

Example: Run -> cmd


Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\xyz>sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 1 16:46:40 2014

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Enter user-name:

San
  • 4,508
  • 1
  • 13
  • 19
  • The problem is that it will show me only single version while the machine can have several installed, I'm creating a setup that should check if certain version is installed now in case there several version install I might not be able to find it. – Epligam Jan 01 '14 at 11:27
  • Check this link, [Oracle Docs](http://docs.oracle.com/cd/B10501_01/em.920/a96697/moh.htm). They have mentioned registry entry HKEY_LOCAL_MACHINE -> Software -> Oracle -> ALL_HOMES, this seems to be useful. – San Jan 01 '14 at 11:43
2

You'll want to query the Oracle Inventory.

For every Oracle installation, there is an entry in the "Oracle inventory". By default, the Oracle inventory is located under "C:\Program Files\Oracle\Inventory". However, this location can be changed.

In the Registry, the location of the Oracle inventory is in "HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE", where you'll find the key "inst_loc". There, you'll find an XML file containing all installed versions (inventory.xml). See the Oracle documentation for an example.

Simon
  • 4,251
  • 2
  • 24
  • 34
  • +1 This is probably the best solution (short of using OEM agent target detection), but it still probably won't be very reliable. In my experience, de-installing Oracle on Windows is very ugly. Those locations very likely get over-looked, and may contain old versions that aren't really installed. – Jon Heller Jan 01 '14 at 22:12
1

Go here and open with Notepad:

  • C:\Program Files (x86)\Oracle\Inventory\ContentsXML
  • C:\Program Files\Oracle\Inventory\ContentsXML

Open File: inventory.xml

<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2006, Oracle. All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>11.1.0.6.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OraClient11g_home1" LOC="D:\Oracle\product\11.1.0\client_1" TYPE="O" IDX="1"/>
</HOME_LIST>
</INVENTORY>
  • 1
    Well,,, actually, the question was "command line or by script", I would advise to provide some sketch to that concept, is possible – MasterAler Mar 13 '21 at 14:49