Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Bash sqlplus command not found       Oracle 10g linux v3

Posted on 2005-05-11
14
Medium Priority
?
6,190 Views
Last Modified: 2008-01-09
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
~
0
Comment
Question by:dplinnane
  • 5
  • 5
  • 3
  • +1
14 Comments
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 13977282
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
 
LVL 48

Expert Comment

by:schwertner
ID: 13977345
#PATH=$PATH:$HOME/bin
is wrong.

Use

#PATH=$PATH:$ORACLE_HOME/bin
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 13977465
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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 13977476
P.S.

the # is a commented line.
0
 
LVL 25

Assisted Solution

by:jrb1
jrb1 earned 300 total points
ID: 13977560
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
 

Author Comment

by:dplinnane
ID: 13977595
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
 

Author Comment

by:dplinnane
ID: 13977615
Copy and past formatting issue led to them being on same lines.
0
 
LVL 48

Assisted Solution

by:schwertner
schwertner earned 600 total points
ID: 13977646
ORACLE_HOME should be all directories up
to 'bin' but without bin.
Check and do this.
0
 
LVL 48

Assisted Solution

by:schwertner
schwertner earned 600 total points
ID: 13977662
use


% printenv

to see if your script really sets the environment variables
0
 

Author Comment

by:dplinnane
ID: 13977717
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
 
LVL 78

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 600 total points
ID: 13977752
After changing the ORACLE_HOME variable,  $ORACLE_HOME/bin needs added to PATH again.
0
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 600 total points
ID: 13977781
>>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
 

Author Comment

by:dplinnane
ID: 13977980
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
 

Author Comment

by:dplinnane
ID: 13978010
Split point sfor effort
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question