Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

sqlplus command not found on Linux

582189Jun 9 2007 — edited Feb 24 2011
After installed Oracle XE on Centos 4.3, when I enter
sqlplus system/password@orcl that said command not found, can anyone tell
me what happen ?


Thanks

Comments

495573
You can find it in your ORACLE_HOME\bin Further: it´s easy to set your enviroment variables in your profile.

By the way: with which user do you have start sqlplus? (with oracle or another user?)

Regards,
B
582189
I use root account
Paul M.

oracle OS user should have all needed environment variables set within its profile, .bash_profile if you use bash.

You shouldn't run sqlplus as root, you should do it as oracle user instead.

If you, for any reason, need to do it as root, then you could run the oracle's profile before, e.g.

# . <oracle's home directory>/.bash_profile
# sqlplus .........
582189
ok, now I use oracle to login, when I run ./sqlplus in bin directory it said the
following:

bash-3.00$./sqlplus
Error 6 initializing SQL*Plus
Message file sp1<lang>.msb not found
SP2-0750: You may nedd to set ORACLE_HOME to your Oracle software directory
582189
I use oracle XE for Compiere, when I run RUN_ImportCompiere.sh it said:

..............
...............
...............
sqlplus haha/haha@xe @/pot/Compiere2/utils/oracle/AfterImport.sql
oracle/ImportCompiere.sh: line 46: sqlplus: command not found
Paul M.
You may nedd to set ORACLE_HOME to your Oracle software directory
Seems that you need some environment variable settings. What's the content of oracle's .bash_profile ?
582189
Sorry, where can find the .bash_profile on oracle user ?

Thanks
Paul M.
You should have it in oracle's home directory (see my post above).

It should be /usr/lib/oracle/xe
582189
Sorry, I type ls -la cannot see the .bash_profile
Paul M.

Then create it with this line :

source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

logout oracle, logon again and retry.

582189
You mean manual create the .bash_profile and then create this sourace line into
.bash_profile?


Thanks !
Paul M.
Yes, use any editor (vi ?), insert that line and save the file. Or you can also do (as oracle user) :

$ cd
$ echo "source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh" > .bash_profile

then logout oracle and logon again.
582189
sqlplus command not found
Paul M.
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

do you have this file on your system ? if so, what's its content ?
582189
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export ORACLE_HOME
ORACLE_SID=XE
export ORACLE_SID
NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export NLS_LANG
PATH=$ORACLE_HOME/bin:$PATH
export PATH
if [ $?LD_LIBRARY_PATH ]
then
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=$ORACLE_HOME/lib
fi
export LD_LIBRARY_PATH
Paul M.
That's correct, so it should work, if you didn't make any mistake....

Try it at command line :

$ source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
$ sqlplus .......
582189
Enter user-name

I think it correctly
582189
ok.... I enter a mistake .... so now I can use the sqlplus command


Thanks you very much !!!!!!!
466785
Hi!
Run this on your system:

find / -name sqlplus -print

On the output of this command you should have some lines telling you where are the sqlplus command.
By example, imagine that the output has something like this:
/u01/app/oracle/product/database/bin/sqlplus
Then, execute this:

ORACLE_HOME=/u01/app/oracle/product/database
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin
export PATH

Then try to run sqlplus again.
Tell me if this worked for you.

Greetings!

HeCSa.
842711
Thank you for this topic!
1 - 20
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 24 2011
Added on Jun 9 2007
20 comments
120,176 views