Think Foward Logo Tested on Oracle 7 Tested on Oracle 8.0 Tested on Oracle 8i

Shell Script

Show Installed Oracle Version

Updated: 08-Oct-2002
Version: 1.2

Description

This script will list out all Oracle products installed by the last Oracle install. 

It provides a simple way to get all versions of all Oracle products installed on a UNIX environment and does NOT need the database to be started. It uses the oratab file as it's starting point, so make sure it's up to date.

Now works better with 8i installs.

Parameters

$1 - ORATAB location (OPTIONAL)

SQL Source

REM Copyright (C) Think Forward.com 1998- 2005. All rights reserved. 
#! /bin/ksh if [ -z "${1}" ]; then # Locate oratab file, exit if we can't find it if [ -f /etc/oratab ]; then ORATAB="/etc/oratab" ; elif [ -f /var/opt/oracle/oratab ]; then ORATAB="/var/opt/oracle/oratab" ; else echo echo "ERROR: Unable to locate oratab file" exit 1 ; fi else ORATAB=$1 fi # Display Simple Header echo echo "Oracle Software Version(s) Installed on" `date` echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" # LOOP for each unique ORACLE_HOME found in the oratab # Get the oracle version from the install log for i in `egrep '^[a-zA-Z].*:.*:.*$' $ORATAB | awk -F: '{ print $2}' | sort -u ` do echo echo "Software Installed In ORACLE_HOME = " $i echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" if [ -f $i/install/unix.rgs ]; then grep '"rdbms"' $i/install/unix.rgs | awk -F\" '{ print $6 " " $4}' echo echo "Consists of the following Software" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" cat $i/install/unix.rgs | sort elif [ -f $i/orainst/unix.rgs ]; then grep '"rdbms"' $i/orainst/unix.rgs | awk -F\" '{ print $6 " " $4}' echo echo "Consists of the following Software" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" grep -v '"rdbms"' $i/orainst/unix.rgs | awk -F\" '{print $6 " " $4}' | sort else echo "ERROR: Unable to locate installation registry" return 1 ; fi done exit 0

Return to Index of SQL Scripts


Site Map

General Information : Home | Company Profile | Contact Us | Legal
Database Support : Proactive Support | Pay Per Incident Support
Expert Services : High Availability | Creative Solutions | Training
Build Services : Oracle Installations | Revive your Oracle Setup | Low Cost Development
Free Oracle Resources: DBA Scripts | Oracle Links