Systems Engineering and RDBMS

  • Click Here for Decipher's Homepage


  • Categories

  • Questions?

    Please send your wish list of things that you would like us to write about or if you have suggestions to help improve this blog site. You can send all questions/suggestions to: Blog Support
  • Archives

  • Blog Stats

    • 7,606,418 Views

Checking for Oracle Client Version on Windows

Posted by decipherinfosys on February 10, 2007

There are many different ways of finding out the client version of Oracle on Windows but if you are using the registry or looking for the physical folders to ascertain that, you are in for a shock when the version changes (even with updates in the same release set like, 9.2.0.x).  This becomes important for application development shops since they have to write an install package and the install scripts need to check and log which version of the client is running and if that version of the client is not supported by that release version of the product, then appropriate action needs to be taken by that code.

Some people use SQL *PLUS or some other dlls to determine the client version but depending upon how the install was done, those client tools or dlls may not be installed (say the Administrative mode was not chosen and only the runtime mode was chosen during the client installation process).  Moreover, the version information for those dlls do not always reflect the right client version.  Here is a sure-shot way of ascertaining the client version on a windows box and this does not change with the release of the Oracle client:

This can be done by just executing tnsping and piping the output to a file and parsing that file for the version info.  tnsping will get installed with each client install regardless of the install options choosen and it’s version is the same as the Oracle client dll versions.  So this is what we can do:

Have a text file dynamically created with the version banner in it:
a. create a batch file called version.bat
b. put 1 line in test.bat:
tnsping > version.txt
c. execute version.bat
d. version.txt will have your version string in it

In the event of multiple Oracle homes, the one that is set as the default is the one that will be shown in this version information.

Sorry, the comment form is closed at this time.