I am in terminal in Redhat 5.5 and I need to find out which version of Oracle is installed. I am pretty new at Linux, but I have searched Google for a while and I can't find what I need. I have to locate which version is installed via terminal. I found the Oracle files, but I can't seem to find the version.
I solved this in about 1 minute by just reading the startup script (in my case /etc/init.d/oracle-xe):
less /etc/init.d/oracle-xe
At almost the beginning of the file I found:
ORACLE_HOME=[PATH_TO_INSTALLATION_INCLUDING_VERSION_NUMBER]
This was the quickest solution for me because I knew where the script was located, and that it is used for starting/restarting the server.
Of course, this relies on that the version number actually corresponds to the actual server version, which it should for a correctly installed instance.
As A.B.Cada pointed out, you can query the database itself with sqlplus for the db version. That is the easiest way to findout what is the version of the db that is actively running. If there is more than one you will have to set the oracle_sid appropriately and run the query against each instance.
You can view /etc/oratab file to see what instance and what db home is used per instance. Its possible to have multiple version of oracle installed per server as well as multiple instances. The /etc/oratab file will list all instances and db home. From with the oracle db home you can run "opatch lsinventory" to find out what exaction version of the db is installed as well as any patches applied to that db installation.
Enter in sqlplus (you'll see the version number)
# su - oracle
oracle# sqlplus
OR
echo $ORAHOME
Will give you the path where Oracle installed and path will include version number.
OR
Connect to Oracle DB and run
select * from v$version where banner like 'oracle%';
Login as sys user in sql*plus. Then do this query:
select * from v$version;
or
select * from product_component_version;
A bit manual searching but its an alternative way...
Find the Oracle home or where the installation files for Oracle is installed on your linux server.
cd / <-- Goto root directory
find . -print| grep -i dbm*.sql
Result varies on how you installed Oracle but mine displays this
/db/oracle
Goto the folder
less /db/oracle/db1/sqlplus/doc/README.htm
scroll down and you should see something like this
SQL*Plus Release Notes - Release 11.2.0.2
you can also check by
ps -ef |grep -i ora
Source: Stackoverflow.com