Bash sqlplus command not found Oracle 10g linux v3

I have insatlled redhat linux v3 and oracle 10g. The insatllation seemed to go ok now I am trying to get sqlplus working but get the following error. Bash sqlplus command not found  

I have added the following to .bash_profile, however When I do echo $ORACLE_HOME I get nothing returned, I had to run
the following as oracle user $export ORACLE_HOME=/product/oracle/10.1.0    
Not sure why I had to run manually. Anyway I must be doing something wrong no sqlplus?

I have the following in home/oracle/.bash_profile
and I also ran them as Oracle user.  I get $ /product/oracle/10.1.0 Am I missing something?


# .bash_profile
ORACLE_HOME=/product/oracle/10.1.0; export ORACLE_HOME ORACLE_BASE=/product/oracle/admin; export ORACLE_BASE LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib; export LD_LIBRARY_PATH PATH=$PATH:$ORACLE_HOME/bin; export PATH
                                                                                                       
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
                                                                                                       
# User specific environment and startup programs
#commet out below MAy10 2005
#PATH=$PATH:$HOME/bin
                                                                                                       
export PATH
unset USERNAME
~
dplinnaneAsked:
Who is Participating?
 
slightwv (䄆 Netminder) Commented:
>>Is .bash_profile the right file to enter this

I suggest not hard coding these in and rc or profile file.  I suggest using the oraenv scripts provided.  This way when you upgrade to 10.2 and ORACLE_HOME changes, you will have minimal changes to make.
0
 
slightwv (䄆 Netminder) Commented:
Looks like you're missing a semi-colon:

the one after: export ORACLE_HOME  

on the line:
ORACLE_HOME=/product/oracle/10.1.0; export ORACLE_HOME ORACLE_BASE=/product/oracle/admin; export ORACLE_BASE


on a side note, there should be a script called oraenv that is installed with oracle that does all this for you.  Not familiar with Linux installs so I'm not sure exactly where it gets installed.

It would go something like this:
export ORALCE_SID=<sid>
. oraenv
0
 
schwertnerCommented:
#PATH=$PATH:$HOME/bin
is wrong.

Use

#PATH=$PATH:$ORACLE_HOME/bin
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
slightwv (䄆 Netminder) Commented:
schwertner, he had that covered.

although in looking at that line, there's a missing semi-colon there as well:

between:
LD_LIBRARY_PATH  and PATH
0
 
slightwv (䄆 Netminder) Commented:
P.S.

the # is a commented line.
0
 
jrb1Commented:
Aren't these normally on their own lines (at least for readability sake)

ORACLE_HOME=/product/oracle/10.1.0; export ORACLE_HOME
ORACLE_BASE=/product/oracle/admin; export ORACLE_BASE
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib; export LD_LIBRARY_PATH
PATH=$PATH:$ORACLE_HOME/bin; export PATH
0
 
dplinnaneAuthor Commented:
This is what I have now

ORACLE_HOME=/product/oracle/10.1.0; export ORACLE_HOME;
ORACLE_BASE=/product/oracle/admin; export ORACLE_BASE;
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib; export LD_LIBRARY_PATH;
PATH=$PATH:$ORACLE_HOME/bin; export PATH;

Is .bash_profile the right file to enter this, I have seen examples where .bashrc is used and also a profile file.
The .bash_profile is located in /home/oracle

Should I use Oracle home as          add directory Db_1
ORACLE_HOME=/product/oracle/10.1.0/Db_1; export ORACLE_HOME;
0
 
dplinnaneAuthor Commented:
Copy and past formatting issue led to them being on same lines.
0
 
schwertnerCommented:
ORACLE_HOME should be all directories up
to 'bin' but without bin.
Check and do this.
0
 
schwertnerCommented:
use


% printenv

to see if your script really sets the environment variables
0
 
dplinnaneAuthor Commented:
This is bin path /home/oracle/product/10.1.0/Db_1/bin

so I modified .bash_profile
ORACLE_HOME=/product/oracle/10.1.0/Db_1; export ORACLE_HOME;

When I do $echo ORACLE_HOME it gives me old HOME to get new home I have to run on coomand line
[oracle@sqa0009 bin]$ export ORACLE_HOME=/product/oracle/10.1.0/Db_1
[oracle@sqa0009 bin]$ echo $ORACLE_HOME
/product/oracle/10.1.0/Db_1
[oracle@sqa0009 bin]$ sqlplus
bash: sqlplus: command not found


0
 
slightwv (䄆 Netminder) Commented:
After changing the ORACLE_HOME variable,  $ORACLE_HOME/bin needs added to PATH again.
0
 
dplinnaneAuthor Commented:
Now its working had to do the following

# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
                                                                               
# User specific environment and startup programs
#commet out below MAy10 2005
~
THEN IN .bashrc
# .bashrc
                                                                               
export ORACLE_HOME=/home/oracle/product/10.1.0/Db_1
export ORACLE_BASE=/home/oracle/product/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export PATH=$PATH:$ORACLE_HOME/bin
                                                                               
# User specific aliases and functions
                                                                               
# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
0
 
dplinnaneAuthor Commented:
Split point sfor effort
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.