Oracle version information
Hi,
I want to extract oracle version information installed on my host programmatically ( using c++).
Kindly give me the idea, how can get the Oracle version information on windows.
Regards,
Jokhan
[228 byte] By [
Jokhan] at [2007-11-20 11:03:23]

# 1 Re: Oracle version information
Hi all.
A way may be to execute this query
select * from v$version
where banner like 'Oracle%'
You'll get something like this
Oracle8i Enterprise Edition Release 8.1.7.2.0 - 64bit Production
Then you should parse the string and get the version.
I hope this will help you
# 2 Re: Oracle version information
Thanks a lot.
But for this we need to login and then exectue this command?
Is there a way I can avoid loging for the info?
Jokhan at 2007-11-9 13:46:32 >

# 3 Re: Oracle version information
Of course, you must to connect to database in order to execute the query.
If you don't want connect, you should explore the directory where Oracle is installed and find some file that contains this information.
For example, I've found on my computer the file "files.map" in the directory
C:\Oracle\OraHome92Server\inventory\filemap\admin\sample\pfile
that contains the string
initsmpl.ora::{"component","oracle.rdbms","9.2.0.1.0"},
where 9.2.0.1.0 is the Oracle version.
In my opinio this way is unsafe, because from a version to anoter may be change the structure of directory of Oracle installation. Searching on data dictionary is more safe.
A better query is
select VERSION from product_component_version
WHERE PRODUCT LIKE 'Oracle%'
You'll get onlu the version