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.