sqlplus: command not found

I installed Oracle 10.2.1.0 in Ubuntu 10.10..my installation was well,i could even open isqlplus( http://ubuntu.ubuntu-domain:5560/isqlplus/workspace.uix ) and execute some queries..But,back in terminal when i try to login to sqlplus i am getting error

First, your ORACLE_HOME doesn't seem to be set correctly:

ORACLE_HOME=/opt/oracle/oracle/product/10.2.0/db_2

Set the PATH like this:

export PATH=$PATH:$ORACLE_HOME/bin

After setting the above variables,
post the output of:

type sqlplus

hey,here are the results:

So you don't get sqlplus not found any more.
Please post the output of the following command:

pgrep -lf smon

I am getting nothing when i tried the below in the terminal

So your Oracle instance is not started.
Try:

sqlplus / as sysdba
startup

But u see,i have to set the environment variable every time i log in to my oracle user and try to run sqlplus..Why is it like that?

In windows,just install the software and run it..I installed Oracle in my pc on windows not less than 10 times.I didn't face any problem whatsoever,back in Ubuntu why is it like that?
There is no setting of environment variables and stuff like that in Windows

Yes,
on *nix you have to set those variables manually.

Just put them in your .bashrc file (assuming you're using the bash shell)
in your $HOME directory and you'll have them set for every interactive session.

I am very new to this Linux..Could u explain me how to edit that .bash profile?

Just paste this in your terminal and hit enter:

cat << \__eof__ >> "$HOME"/.bashrc
ORACLE_SID=orcl
ORACLE_HOME=/opt/oracle/oracle/product/10.2.0/db_2
PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_SID ORACLE_HOME PATH
__eof__

After that, in order to activate the new settings,
run:

. "$HOME"/.bashrc

Or just open a new terminal.

1 Like

See the result:

Should i enter into root and do that?

No.
It's OK, you don't get sqlplus not found no more and that's because of the variables you set.

As I already told you, you'll need to actually start your Oracle instance:

sqlplus / as sysdba
startup

U seem to be right..but in windows,we can connect with the normal user also..i will recheck everything once again after reboot

now i am unable to open isqlplus,the page cannot be displayed error is coming.

You don't need iSQL*Plus:)

You may need to start it:

"$ORACLE_HOME"/bin/isqlplusctl start

Doesn't Linux have services like in windows where we can go to services.msc and start the desired service we like?

Thanks for the replies

Yes, it has.
But you need to configure your services manually ...

So,one should make a note of all the commands and run in the terminal every time we log in to our user.
by the way,i am not getting oracle in my applications menu..Any idea?

Why do you think it should be there? At most you'll have a shortcut to dbconsole ...

---------- Post updated at 04:05 PM ---------- Previous update was at 04:05 PM ----------

By the way, I think you need the XE edition, which is free and user friendly :slight_smile:
Give it a try!

When i installed Oracle Xe i got it in the applications menu..now,i don't have any listing regarding Oracle,except that i have a user with oracle which is created during installation of oracle

---------- Post updated at 07:49 PM ---------- Previous update was at 07:37 PM ----------

The changes which i made in the above..will it be permanent?
Everyone are advising to update the environment variables in .bash_profile..But,unfortunately i couldn't find that

---------- Post updated at 09:08 PM ---------- Previous update was at 07:49 PM ----------

Hey,i rebooted my pc and i tried to connect sqlplus..It went well,thanks for ur kind replies..Just,starting the services is what annoying me..But,no issues may be i will get accustomed with that

If you want you scripts ran on system up you can put them in /etc/rc.local
Think of it as something like your startup folder on your Windows machine. :slight_smile:

rc.local is executed after all other startup processes have finished

Edit: So, I thought I would give Oracle XE a shot. Here's a great guide on the initial configuration after install. Hopefully it helps.
http://www.cyberciti.biz/faq/howto-install-linux-oracle-database-xe-server/