What is the best way to determine which version of the Oracle client I am running?

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

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

Did the client install this information into any text file?

+44
windows oracle
Jul 23 '09 at 13:17
source share
13 answers

The TNSPing command line will show the version. Similarly, sqlPlus.exe will print its version. You can also go to readme files in the "relnotes" directory of your client installation. For example, in version 10.2 there is a file called README_jdbc.txt, which will tell you which version was installed.

+27
Jul 23 '09 at 13:30
source share

You can use the v$session_connect_info view against the current session identifier ( SID from the USERENV namespace in SYS_CONTEXT ).

eg.

 SELECT DISTINCT s.client_version FROM v$session_connect_info s WHERE s.sid = SYS_CONTEXT('USERENV', 'SID'); 
+21
Mar 26 '14 at 3:22
source share

On unix

If you do not know the location or version of the installed Oracle product, you can find it from the inventory, which is usually written in /etc/oraInst.loc

 > cat /etc/oraInst.loc inventory_loc=/export/oracle/oraInventory **--> Inventory location** inst_group=dba > cd /export/oracle/oraInventory > cd ContentsXML 

Find the inventory.xml file here

 > cat inventory.xml <?xml version="1.0" standalone="yes" ?> <!-- Copyright (c) 1999, 2010, Oracle. All rights reserved. --> <!-- Do not modify the contents of this file by hand. --> <INVENTORY> <VERSION_INFO> <SAVED_WITH>11.2.0.2.0</SAVED_WITH> <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER> </VERSION_INFO> <HOME_LIST> <HOME NAME="OraDB_11G" LOC="/export/oracle/product/11.2.0.2" TYPE="O" IDX="2"> 

Once you know the installation location

 export ORACLE_HOME=full path to install location export ORACLE_HOME=/export/oracle/product/11.2.0.2 export PATH=$ORACLE_HOME/bin:$PATH 

A simple "sqlplus" will provide you with the version of the installed client.

 > sqlplus SQL*Plus: Release 11.2.0.1.0 Production on Fri Mar 23 14:51:09 2012 Copyright (c) 1982, 2010, Oracle. All rights reserved. Enter user-name: 

In the above example, the Oracle client version is 11.2.0.1

In windows

Registry location variable in INST_LOC windows

 Start > Run > regedit > HKLM > Software > Oracle 

Check the value of the Inst_loc entry that will be installed at the software installation location.

You can use the command line, or you can navigate / explore the original oracle location and then cd to bin to lauch sqlplus, which will provide you with client version information.

+8
Mar 23 '12 at 17:02
source share

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

Typical Oracle installations will store inventory information in C: \ Program Files \ Oracle \ Inventory, but figuring out installed versions is not just opening a text file.

This is the authority of AFAIK and shows any corrections that may have been applied (which does not work with utilities).

EDIT: The CLI option will use the OPatch utility:

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

This gives you a generic version of the installed client.

+6
Jul 23 '09 at 15:10
source share

Problem # 1: Several Oracle clients are installed.

A very common problem that I see in my environment is that I see both workstations and (applications) servers with several Oracle clients, sometimes as many as four and possibly with different versions and architectures. If you rely on PATH and run a utility like SQLPLUS or TNSPING , you will have one of two invalid results:

  • either your PATH successfully resolves the executable file, and you get the result of ONE version
  • or PATH did not allow the executable, and you did not get any results.

In any case, you are blind to the possibilities of several client installations.

Problem # 2: The Instant Client does not have TNSPING and sometimes does not include SQL * Plus.

If the Instant Instant Client (and not the full client) is installed on the computer, then TNSPING not enabled, and SQLPLUS is an additional add-on. Therefore, I cannot rely on the tools that are there. In addition, the Instant Client is sometimes installed as an unzip-and-go solution, so there is no Oracle Inventory and nothing in HKLM.

Problem # 3: The client was installed using Custom, but ODBC, OLEDB, ODP.Net, and JDBC were not installed.

The obvious case is that there will be no reading of ODBC or JDBC to clear version information.

Decision:

One thing that has an Instant Client and a Full Client is a DLL file called oraclient10.dll , oraclient11.dll , usually: oraclient*.dll . So, go to your hard drive to find them and extract information about your version. PowerShell amazes with this and can do it in one line, reminds me of Unix home sweet. That way you can do it programmatically or even remotely.

Here is one-line (sorry for the right scroll, but for the nature of the one-line, eh?). Suppose you are already in PowerShell:

 gci C:\,D:\ -recurse -filter 'oraclient*.dll' -ErrorAction SilentlyContinue | %{ $_.VersionInfo } | ft -Property FileVersion, FileName -AutoSize 

And if you are not in PowerShell, i.e. you are just in the CMD shell, then there is no problem, just call powershell " ... " as follows:

 powershell "gci C:\,D:\ -recurse -filter 'oraclient*.dll' -ErrorAction SilentlyContinue | %{ $_.VersionInfo } | ft -Property FileVersion, FileName -AutoSize" 

Results Examples

Here are some outputs from some of my systems. This bad citizen has 3 Oracle 11.2.0.3 clients. You can see that some of them are 32-bit and others 64-bit:

 FileVersion FileName ----------- -------- 11.2.0.3.0 Production C:\NoSync\app\oracle\product\11.2\client_1\bin\oraclient... 11.2.0.3.0 Production C:\oracle\product\11.2.0\client_1\bin\oraclient11.dll 11.2.0.3.0 Production C:\oracle64\product\11.2.0\client_1\bin\oraclient11.dll 

Another system that has a 10g client on D: \

 FileVersion FileName ----------- -------- 10.2.0.4.0 Production D:\oracle\product\10.2\BIN\oraclient10.dll 

Cautions / Problems

  • This explicitly requires PowerShell, which is standard on Windows 7+ and Server 2008 R2 +. If you have XP (which you no longer need), you can easily install PowerShell.

  • I have not tried this on 8i / 9i or 12c. If you use 8i / 9i, then there is a good chance that you are also on the old OS, and you do not have PowerShell and Heaven. It should work with 12c, since I see that there is such a file oraclient12.dll that is being installed. I just don't have a Windows 12c client to play with it.

+6
Jul 01 '14 at 17:14
source share

This is another, though not necessarily the β€œbest” way:

Definition of the current version

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

[Link] Oracle Customer Information http://www.ohio.edu/technology

+3
Jul 23 '09 at 13:26
source share

You must put a semicolon at the end of select * from v$version; .

It seems that you will get all the necessary information ...

If you are looking only for Oracle, you can do it like:

 SQL> select * from v$version where banner like 'Oracle%'; 
+3
Mar 22 '12 at 13:50
source share

you can use the following command in SQL Developer or SQLPLUS on the command line to find out the version number.

 select * from v$version; 

in my case, he gave me the information below.

 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production PL/SQL Release 11.2.0.1.0 - Production "CORE 11.2.0.1.0 Production" TNS for 64-bit Windows: Version 11.2.0.1.0 - Production NLSRTL Version 11.2.0.1.0 - Production 
+3
Sep 27 '16 at 6:32
source share

On Windows -> use Command Promt:

tnsping localhost

Shows the version, and if a 32-bit 64-bit client is installed, for example:

TNS Ping Utility for 64-bit Windows: Version 10.2.0.4.0 - Issued on 03-MAR-2015 16:47:26

Source: https://decipherinfosys.wordpress.com/2007/02/10/checking-for-oracle-client-version-on-windows/

+2
Mar 03 '15 at 20:04
source share

Go to Control Panel β†’ Administrative Tools and open Data Sources (ODBC). By default, the "User-DSN" tab will open, click "Add" and a dialog will appear:

enter image description here

+2
Dec 15 '15 at 8:42
source share

I assume you want to do something programmatically.

You might think of using getenv to infer a value from the ORACLE_HOME environment variable. Assuming you say C or C ++ or Pro * C.

+1
Jul 23 '09 at 15:30
source share

Go to ORACLE_HOME / bin and run the sqlplus file. see conclusion below.

 64-Bit:- cd /tech/oracle/product/v11/bin $ file sqlplus sqlplus: **ELF 64-bit** LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped 32-Bit $ cd /tech/oracle/product/11204_32bit/bin $ file sqlplus sqlplus: **ELF 32-bit** LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped 
0
Dec 15 '15 at 17:12
source share

Just run this: select * from v $ version

-2
Oct 31 '11 at 20:56
source share



All Articles