Link to home
Start Free TrialLog in
Avatar of dplinnane
dplinnaneFlag for United States of America

asked on

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
~
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

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
#PATH=$PATH:$HOME/bin
is wrong.

Use

#PATH=$PATH:$ORACLE_HOME/bin
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
P.S.

the # is a commented line.
SOLUTION
Avatar of jrb1
jrb1
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dplinnane

ASKER

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;
Copy and past formatting issue led to them being on same lines.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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


SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Split point sfor effort