1833016 Members
2223 Online
110048 Solutions
New Discussion

oracle version

 
SOLVED
Go to solution
Hanry Zhou
Super Advisor

oracle version

how do I know what version of oracle is running on hpux11.0 server?

Thanks,
none
21 REPLIES 21
Stefan Farrelly
Honored Contributor

Re: oracle version

cat /etc/oratab

The info on db names and versions of oracle is usually stored there.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Jeff Schussele
Honored Contributor

Re: oracle version

Hi Hanry,

Well if your DBAs are like ours they embed the version in the path to the executables - like:

/oracle/product/8.1.7/bin......

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Ken Hubnik_2
Honored Contributor

Re: oracle version

Look in the pfile for oracle for all the oracle parameters and version.

/oracle/admin/lawsonp/pfile
Ken Hubnik_2
Honored Contributor

Re: oracle version

Look in the pfile for oracle for all the oracle parameters and version.

/oracle/admin/xxxxxxx/pfile
Hanry Zhou
Super Advisor

Re: oracle version

thanks for the message.

Can the variable ORACLE_HOME tell the exact version I am running?

The server could be switched back and forth between two different oracle version, so directories like /oracle/product/8.1.7/bin and /oracle/product/9.1.1/bin both are exsisted on the server. I meant what exactly files, variable, or daemons controle which version of oracle I kick off?
none
H.Merijn Brand (procura
Honored Contributor

Re: oracle version

lep l1:/pro/po/lep/4gl 107 > which sqlplus
/pro/oracle/v817/bin/sqlplus
lep l1:/pro/po/lep/4gl 108 > strings `which sqlplus` | grep 9000
HP9000/800-7.0-8.1.0
lep l1:/pro/po/lep/4gl 109 >

But that's only showing the major version info.

--8<---
$ENV{ORACLE_HOME} = $ORACLE_HOME = chase_dir ($ora_home);
$opt_v and print STDERR "ORACLE_HOME\tset to $ORACLE_HOME\n";
my $shlibp = $^O eq "aix" ? "LIBPATH" :
$^O eq "hpux" ? "SHLIB_PATH" : undef;
if ($shlibp) {
$ENV{$shlibp} //= "/usr/lib:/lib";
$ENV{$shlibp} .= ":$ORACLE_HOME/lib";
}

# 7.3.4
for (qw(orainst/unix.rgs orainst/unix.prd unix.prd)) {
local $/ = undef;
open my $info, "< $ora_home/$_" or next;
$opt_v > 7 and print STDERR "Scanning $_ for version info ...\n";
<$info> =~ m/\brdbms_common\b.*?"([\d.]+)"/s or next;
$prod[5] = $1;
last;
}
unless ($prod[5]) { # 8.1.7
for (qw(install/unix.rgs)) {
local $/ = undef;
open my $info, "< $ora_home/$_" or next;
$opt_v > 7 and print STDERR "Scanning $_ for version info ...\n";
<$info> =~ m/^rdbms\s+([\d.]+)/m or next;
$prod[5] = $1;
last;
}
}
$opt_v and print STDERR "ORACLE_VSN\tis $prod[5]\n";
-->8---

Above code snippet is in Perl and deduces the correct installed version from the files available from the current installation. Now that Oracle is changing that over time (and why should they not, they rule the world, don't they?), it's a tedious process. I don't have this info (yet) for Oracle 9

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Stefan Farrelly
Honored Contributor
Solution

Re: oracle version

I think its controlled from the oracle variable ORACLE_SID
This specifies the database, which gets looked up in /etc/oratab - which loads the version of oracle to start for that db.
Im from Palmerston North, New Zealand, but somehow ended up in London...
blal
Frequent Advisor

Re: oracle version

Hi

Login as root and change to oracle user .
(u can find out the which is the oracle user by using ps -aef |grep -i pmon ,and see who is the owner of pmon process)

for example
#su - oracle

then connect to sql using

$sqplus /nolog
SQl>connect internal;
SQL>select * from v$version;
SQL>exit;

This will display all the realted version informations.

regds,
baiju.
Live and let live.
Ken Hubnik_2
Honored Contributor

Re: oracle version

Generally ORACLE_HOME would have the version as part of the path name but like any variable it can be anything.
Kevin O'Donovan
Regular Advisor

Re: oracle version

Hi,

haven't used Oracle in a while, but I used to run one of the admin utilities, not sqlplus but another one you could run sql commands in. Memory is shot, should know that... but anyway, the version or Oracle came up in the header when you run the program.

The ways the other guys mentioned look a lot more scientific though!

With regards to what files and stuff you need to set, just the 2
ORACLE_HOME
ORACLE_SID
watch though, you may have to adjust your PATH variable too - I used to add $ORACLE_HOME/bin to my PATH variable so that would prob need to be changed too if you're going from one to the other.
I don't remember Oracle having MAN pages, but MANPATH would need to be updated too if it does.

We had test machines, each user needing to run sqlplus or whatever so using Oracle, and the only differences between the accounts were the ones above.

hope that helps,
Kevin.
H.Merijn Brand (procura
Honored Contributor

Re: oracle version

Baijulal, thanks. I didn't know that one (yet), but it has one disadvantage over my solution: it only works on instances that are up and running, where my solution also work on instances that are shut down.

Something to consider.

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Hanry Zhou
Super Advisor

Re: oracle version

Where is pfile supposed located?
I searched the entire server, but could not find the pfile.
none
Tim Sanko
Trusted Contributor

Re: oracle version

Henry for 9 points, here is what might be the answer for newbies that is the most easy to do.

1. su - oracle.
2. cd $ORACLE_HOME ; pwd
this will give you an active version.

For Admins who need more info

3. as root: find / -name product
cd to the product directory if the DBAs
set the DB up as OFA compliant,
ls will give you the major number
4. if there is only one product there you are done.

For Admins who need even more info

5. ps -ef | grep ora_pmon (this will give you one response per active instance)

6. cat /etc/oratab this will have the original installed versions/DB

7. find / -name config\*.ora -print (this will tell you where the configuration file is kept
that will have the structure and the active db info.
Jeff Schussele
Honored Contributor

Re: oracle version

Hi (again) Hanry,

pfile is a directory, not a file.
It's usually located under the admin directory in a directory named for the SID.
SO a normal path would be
/oracle/admin/SID_NAME/pfile
Then the version info is in the file named
configSID_NAME.ora
grep "compatible" in that file for the version.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Massimo Bianchi
Honored Contributor

Re: oracle version

Hi,
the only wya to know which oracle version you are running is to connect to oracle itself.


The version depends on the script that starts the instance, irregarding of the setting of the environtment.


So, to check:

i assume that your oracle_sid is WHOAMI



su -

sqlplus user/password@WHOAMI
SQL>select version from v$instance;

will tell you to which oracle you are connecting.

Massimo

twang
Honored Contributor

Re: oracle version

1.
# echo $ORACLE_HOME
2.
# cat /etc/oratab
3. or login roacle,
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
PL/SQL Release 8.1.7.4.0 - Production
CORE 8.1.7.0.0 Production
TNS for HPUX: Version 8.1.7.4.0 - Production
NLSRTL Version 3.4.1.0.0 - Production

Hanry Zhou
Super Advisor

Re: oracle version

I have checked out 2 Oracle servers, and found nothing about pfile directory, is it possible it may be environment dependent.

And also how to located the correct corresponding ora file, I have found a lot of *.ora file, but don't know which one is the one the oracle is using. may be by different name convention, we don't have config\*.ora file.
none
Francis_12
Trusted Contributor

Re: oracle version

Hello,

All Oracle products and their respective versions do not comply with SD-UX IPD (Installed Product Database). This means that all sw* commands are unable to display them.

Just do :

#cat $ORACLE_HOME/orainst/unix.rgs

And you will have all Oracle softwares and their versions displayed.

Hope this helps,

Bye.

Francis - HP-UX ASCE.
malay boy
Trusted Contributor

Re: oracle version

Hi,

Here are something about pfile.Pfile are static parameter file for oracle.Pfile is a text file that can be maintained using standard os editor.The pfile is read only during system startup.By default the pfile are located on $ORACLE_HOME/dbs directory and names initSID.ora .

For 9i,it have persistent parameter file called SPfile.It commonly refred as spfile.ora

To search for pfile do : find / -name '**.ora' -print

hope this help.

pfile is a file not a directory.

regards
mB


There are three person in my team-Me ,myself and I.
Jeff Schussele
Honored Contributor

Re: oracle version

Hi mB,

Well, I'm not a DBA, but I looked at a Dev system that had multiple SIDs and mult Oracles vers on it & our DBAs set pfile as a distinct dir name *below* the SID name dir. Like all vars it can be wherever you want and whatever you want to name it - just set the var right....
They also had 2 files in each - config$ORACLE_SID.ora & init$ORACLE_SID.ora
Guess it's clearer on mult SID systems to do it this way - but on a single instance system you don't need the differentiation.

Cheers,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
twang
Honored Contributor

Re: oracle version

In general, in unix, configSID.ora is saved in
$ORACLE_HOME/dbs/configSID.ora