Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to find out oracle version

Status
Not open for further replies.

chz013

Programmer
Jan 5, 2003
73
US
Hi
How do I find out what version of Oracle is running
on my system ? ie is it 8i, 9i, etc....
I tried searching the Oracle's ENV variable to figure it
out but none was set in /etc/profile.

But I do see processes
test->ps -ef | grep ora
oracle 410 1 0 May 11 ? 0:00 ora_pmon_base1
oracle 412 1 0 May 11 ? 0:00 ora_dbw0_base1
oracle 414 1 0 May 11 ? 0:00 ora_lgwr_base1
oracle 416 1 0 May 11 ? 0:00 ora_ckpt_base1
oracle 418 1 0 May 11 ? 0:00 ora_smon_base1
oracle 420 1 0 May 11 ? 0:00 ora_reco_base1
oracle 422 1 0 May 11 ? 0:00 ora_s000_base1
oracle 424 1 0 May 11 ? 0:00 ora_d000_base1
root 21209 21191 0 14:37:32 pts/4 0:00 grep ora

Lastly
where can i learn more on Clinical Oracle ?

 
select *
from v$version

this will tell you what baseline (7.3.x, 8.0.x, 8.1.x, etc.) you running as well as what patchsets have been applied (8.1.7.4.0, etc.) for core components. unfortunately, it won't tell you (nor am I aware of a way besides diligence to tell) if any 1-off bug fixes (patch.sh) have been applied.

lastly,
what is "Clinical Oracle"?
is that a vertical Oracle Applications thing?
 
I use MySQL and new to Oracle.
What process should I start or look for to start Oracle ?
Only then I can use

select *
from v$version


 
AH! that is a different ? altogether...

when you say "start Oracle" I assume you mean SQL*Plus (~= mysql -u$user -p) since the ps in your 1st post indicates the instance is already running.

if you su - oracle and env | grep ORA do you see ORACLE_HOME and ORACLE_SID? if not you may want to start a recursive find/grep for those variables as they must be set to use sqlplus (all versions) and/or svrmgrl (8.0.x & earlier). I can tell you that your $ORACLE_SID is base1 (suffix of instance processes). if you do a ps -fu oracle | grep LISTENER it will give you the path to/value for $ORACLE_HOME assuming you have a TNS Listener running (should be something like /$mountpoint/$intermediate_directories/oracle/product/$version).

for example if ps -fu oracle | grep LISTENER results:

/opt/oracle/product/8.1.6/network/bin/tnslsnr LISTENER -inherit

then ORACLE_HOME=/opt/oracle/product/8.1.6

export both these variables, cd $ORACLE_HOME/bin and ./sqlplus internal. if whoever set it up didn't create a password file you're the Oracle equivilant of root. if they did you better hope you can find someone w/the passwords.

good luck & reply if you need more info...

it might help if you said what you're trying to accomplish: write a DBI Perl script, port a mySQL DB, run backups, get an ERD, etc.
 
DBAwhosaysNIE
Thanks for your response.

This is what I did.

test->ps -fu oracle
UID PID PPID C STIME TTY TIME CMD
oracle 410 1 0 May 11 ? 0:00 ora_pmon_base1
oracle 412 1 0 May 11 ? 0:00 ora_dbw0_base1
oracle 414 1 0 May 11 ? 0:00 ora_lgwr_base1
oracle 416 1 0 May 11 ? 0:00 ora_ckpt_base1
oracle 418 1 0 May 11 ? 0:00 ora_smon_base1
oracle 420 1 0 May 11 ? 0:00 ora_reco_base1
oracle 422 1 0 May 11 ? 0:00 ora_s000_base1
oracle 424 1 0 May 11 ? 0:00 ora_d000_base1

test->env | grep ORACLE
test->

nothing is returned

test->ps -fu oracle | grep LISTENER
test->

nothing is returned.

I dont see ORACLE_HOME and ORACLE_SID

"if not you may want to start a recursive find/grep for those variables as they must be set to use sqlplus (all versions) and/or svrmgrl (8.0.x & earlier)."

How do I do that ?

What's your next suggestion then ?

Somebody in the company installed this a while back and
he's gone. I'm trying to recover where he left off.

 
find . -type f -name ".*" -exec grep -l 'ORACLE_' {} \;

will search hidden (ex. .profile .bash_profile) text files

find . -type f -name "*" -exec grep -l 'ORACLE_' {} \;

will search non-hidden ones

I would do a df -k 1st and run it a filesystem at a time as opposed to doing it on root (no need to hit /proc)
 
I tried

test->find . -type f -name ".*" -exec grep -| 'ORACLE_' {} \;
find: incomplete statement
bash: ORACLE_: command not found

btw i use bash

test->find . -type f -name "*" -exec grep -|'ORACLE_' {}\;
find: incomplete statement
bash: ORACLE_: command not found

root:mlc3 203.8.22.3->pwd
/
root:mlc3 203.8.22.3->df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 1666143 1346852 269307 84% /
/proc 0 0 0 0% /proc
fd 0 0 0 0% /dev/fd
mnttab 0 0 0 0% /etc/mnttab
swap 473032 8 473024 1% /var/run
swap 473704 680 473024 1% /tmp
/dev/dsk/c0t0d0s7 1885495 830403 998528 46% /home
/dev/dsk/c0t3d0s0 8705501 5305385 3313061 62% /export/usr1/abc
 
| (pipe) is not a valid switch for grep; try l (as in Larry:)

I'd run it on the bottom two filesystems 1st; I'd guess it's in one of them.

another way to do this is

lsof -p 410 | grep dbs

your ORACLE_HOME is the path less the /dbs at the end
 
Thanks
This is what I got:

test->find /home -type f -name "*" -exec grep -l 'ORACLE_' {} \;

/home/swap1

test->find /home -type f -name ".*" -exec grep -l 'ORACLE_' {}
\;
/home/jc/.bash_history
/home/oracle/.profile
/home/oracle/.profile.orig
/home/oracle/.profile.oas
/home/oas/.profile

So what's next ?
 
I further tried this:

test->su - oracle
-sh: -o: bad option(s)
$ env | grep ORA
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/8.1.5
ORACLE_SID=base1
$ ps -fu oracle
UID PID PPID C STIME TTY TIME CMD
oracle 410 1 0 May 11 ? 0:00 ora_pmon_base1
oracle 412 1 0 May 11 ? 0:00 ora_dbw0_base1
oracle 414 1 0 May 11 ? 0:00 ora_lgwr_base1
oracle 416 1 0 May 11 ? 0:00 ora_ckpt_base1
oracle 418 1 0 May 11 ? 0:00 ora_smon_base1
oracle 420 1 0 May 11 ? 0:00 ora_reco_base1
oracle 422 1 0 May 11 ? 0:00 ora_s000_base1
oracle 424 1 0 May 11 ? 0:00 ora_d000_base1
oracle 27167 27164 0 15:22:31 pts/13 0:00 -sh
oracle 27388 21191 0 15:38:41 pts/4 0:00 -sh
oracle 27262 27258 0 15:29:13 pts/14 0:00 -sh
$ ps -fu oracle | grep LISTENER
$

I dont seem to get what talked about "/opt/oracle/product/8.1.6/network/bin/tnslsnr LISTENER -inherit"

any help is appreciated
 
from a root shell do the following:

su - oracle #like your most recent port
#check_your_environment
env | grep ORACLE #like your most recent port
#if you do not have those variables like before then
. /home/oracle/.profile #go back to check your environment
# else
sqlplus /nolog
#you should be at a SQL> prompt
connect internal
#you should be Bruce Almighty now
#unless whoever set it up created a password file
#in which case you have a more complicated problem

FWIW, 99.9% you're running 8.1.5 (1st release of 8i) though ORACLE_HOME does not HAVE to correspond to release though installer defaults it and I can't imagine why someone would override to another valid baseline (unless they wanted to confuse their successor).

again, if you could provide a better description of what DBA-type tasks you're trying to accomplish we could be more helpful...
 
To find the Oracle version, first find your ORACLE_HOME:

$ echo $ORACLE_HOME

Then start the SQL*Plus and see the version:

$ sqlplus /nolog

Connected to:
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
With the Partitioning option
JServer Release 8.1.7.4.0 - Production

SQL>


TO learn Oracle Clinical - get the Oracle course from Oracle University. They teach all the nuts & bolts of it.


Hope that helps,

clio_usa - OCP DBA
------------------



Hope that helps,
clio_usa - OCP DBA
------------------
 
clio_usa
thanks for responding.
Is there a free trial version for Oracle Clinical ?
Where can I find it, a free tutorial lesson ?

DBAwhosaysNIE
I'm trying to learn using Oracle.
Is there a similar command to MySQL's
create database ?
My thinking is that I need to create a database
and then create a few tables within this database.
From Oracle 8i reference text, I cant find it.
Is oracle only supporting create tables ?

 
Lesson 1
=========
Looks like in order to query version, I have to
type connect internal.
What's the 2 about ?
Do I have to keep pressing the enter key
in order to view the query result, in this
case, version numbers ?


SQL> connect internal
Connected.
SQL> select * from v$version
2 ;
[ HAD TO PRESS ENTER KEY TO SEE RESULTS BELOW. WHY ? ]

BANNER
----------------------------------------------------------------
Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
PL/SQL Release 8.1.5.0.0 - Production
CORE Version 8.1.3.0.0 - Production
TNS for Solaris: Version 8.1.5.0.0 - Production
NLSRTL Version 3.4.0.0.0 - Production
 
the "2" is the line # (mysql just keeps doing ->)

are you saying you had to press the enter key twice (once after ; and then again)? if so that shouldn't be.

Oracle does have a create database command but it has a VERY different context than mysql and requires a fairly length procedure to complete (topic for another post). I suspect all you really need to do is create a user and possibly tablespace for what you're trying to do. see create user and create tablespace in html docs for reference.
 
I try to create a user,
SQL> create user c3po identified by c3po;
create user c3po identified by c3po
*
ERROR at line 1:
ORA-01109: database not open


SQL>

So what should i do next ?
What command should i type to find out all the database
that exist ?
I'm not sure if I have root/admin priviledge.
In typing
sqlplus /nolog
I dont get prompted for userid and password.

 
DBAwhosaysNIE, cliousa

I found that in $ORACLE_HOME/dbs
in file afiedt.buf
it contains a line like this below:

create database link star_db connect to qwert identified by "post" using 'mop'

so when I try to login using sqlplus
Enter user-name: qwert
Enter password: (after typing in password and press Enter)
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress

Why is that ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top