views:

1362

answers:

4

The subject says it all: What is the best way to determine the exact version of the oracle client I'm running? Our clients are all running Windows.

I found one suggestion to run the tnsping utility, without parameters, which does display the version information. Is there a better way?

Does the client install put this information in any sort of text file?

A: 

This is another, though not necessarily "better", way:

Determining Your Current Version

To determine which Oracle client version you have installed on your pc, run sql*plus to connect to the DW. The folder names may vary somewhat based on your Oracle setup but should be similar. To run sql*plus choose start > programs > Oracle > Oracle - OUDWclient > Application Development > sqlplus. Enter your DW user name, password, and 'ordj' for the host name or service name. This should connect you to the DW via sqlplus. At this point, you could write your own sql statements to pull information from the DW (if you knew sql). The Oracle client version can be determined in the first line - 'SQL*Plus: Release 10.2.0.1.0'.

[Reference].

pianoman
+1  A: 

TNSPing command line will show the version. similarly, sqlPlus.exe will print its version. You can also go to the readme files in the 'relnotes' directory of your client install. Version 10.2 has a file named README_jdbc.txt, for example, which will tell you which version has been installed.

akf
+1  A: 

Run the installer, click "Installed Products...". This will give you a more detailed list of all installed components of the client install, e.g., drivers, SQL*Plus, etc.

Typical Oracle installations will store inventory information in C:\Program Files\Oracle\Inventory, but figuring out the installed versions isn't simply a matter of opening a text file.

This is AFAIK authoritative, and shows any patches that might have been applied as well (which running the utilities does not do).

EDIT: A CLI option would be to use the OPatch utility:

c:\> path=%path%;<path to OPatch directory in client home, e.g., C:\oracle\product\10.2.0\client_1\OPatch>
c:\>set ORACLE_HOME=<oracle home directory of client, e.g., C:\Oracle\product\10.2.0\client_1>
c:\>opatch lsinventory

This gives you the overall version of the client installed.

DCookie
A: 

I am assuming you want to do something programatically.

You might consider, using getenv to pull the value out of the ORACLE_HOME environmental variable. Assuming you are talking C or C++ or Pro*C.

EvilTeach
In windows, ORACLE_HOME is typically not set - it's in the registry. Even if it were, the typical ORACLE_HOME setting would be a path you'd have to parse the version number out of (assuming a default install - you could install it anywhere) and that version (at least in 10g) is only specified as '10.2.0'.
DCookie
yep, that is how we extract it.
EvilTeach