Skip to Main Content

Oracle Database Discussions

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

842009Mar 5 2011 — edited Mar 5 2011
Hi,

i am newbie to oracle.tried installing oracle 10g in ubuntu.
i am successful with the oracle installation.
i am able to login to sqlplus using oracle OEM,but when i try to login through command prompt , i get the following error:



rakesh@ubuntu:/$ sqlplus "/ as sysdba"
bash: sqlplus: command not found

rakesh@ubuntu:/$ sqlplus
bash: sqlplus: command not found


i have also tried to set the oracle_home, oracle path & oracle SID.

please find the below configuration parameters which i have set to.


----------------------------------------------------------------------------------------------------------------------------------


root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# more oracle_env.sh
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`
NLS_LANG='$ORACLE_HOME/bin/nls_lang.sh´ > 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

------------------------------------------------------------------------------------------------------------------------------------------

Please help me out.

Thanks & Regards,
Rakesh.

Comments

oradba
In /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin

issue

ls sqlplus .

Does it exist?

Werner
842009
Hi,

i tried issuing the below command and got the following output:

ls sqlplus

rakesh@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin$ ls sqlplus
sqlplus

yes,it exists

Regards,
Rakesh

Edited by: user333 on Mar 5, 2011 5:51 PM
oradba
Is it possible the environment is defined in oracle_env.sh, but the script isn't yet executed?

When you get

bash: sqlplus: command not found

check

echo $PATH


Werner
842009
Hi,

echo$PATH gives me following output.


rakesh@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
rakesh@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin$ sqlplus
bash: sqlplus: command not found
rakesh@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin$ sqlplus "/ as sysdba"
bash: sqlplus: command not found



Do i have to restart the system if i edit/set ORACLE_HOME,SID,PATH parameters..??
i am able to access the OEM.
i have not installed any database.by default there was a database installed & named "XE".
when i open the "Run SQLCommand Line" from the Applications tab in ubuntu it displays the following output.

*/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found*
*/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found*

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 5 04:45:18 2011

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL>


Regards,
Rakesh

Edited by: user333 on Mar 5, 2011 6:13 PM
EdStevens
user333 wrote:
Hi,

i tried issuing the below command and got the following output:

ls sqlplus

rakesh@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin$ ls sqlplus
sqlplus

yes,it exists

Regards,
Rakesh

Edited by: user333 on Mar 5, 2011 5:51 PM
try "ls -l sqlplus", not just "ls sqlplus". That will reveal the execute permissions.
842009
ls -l sqlplus gives me the following output:

root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# ls -l sqlplus
-rwxr-xr-x 1 oracle dba 4228 2006-02-24 12:42 sqlplus

but,still i face the same error.
842009
yipeeeeeeeeeeeeeeeee..!!!!!!!!!!!!!!!!!!!!!!!!!

i got the solution...!

i tried giving the read,write,execute permissions to the sqlplus file.and it woked...!!

root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# ls -l sqlplus
-rwxr-xr-x 1 oracle dba 4228 2006-02-24 12:42 sqlplus
root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# chmod 777 sqlplus
root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# ls -l sqlplus
-rwxrwxrwx 1 oracle dba 4228 2006-02-24 12:42 sqlplus
root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 5 07:54:56 2011

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Enter user-name: system
Enter password:

Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL>


now im able to connect to sqlplus. :) :) :)



Regards,
Rakesh.
842009
i tried giving the read,write,execute permissions to the sqlplus file.and it woked...!!

root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# ls -l sqlplus
-rwxr-xr-x 1 oracle dba 4228 2006-02-24 12:42 sqlplus
root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# chmod 777 sqlplus
root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# ls -l sqlplus
-rwxrwxrwx 1 oracle dba 4228 2006-02-24 12:42 sqlplus
root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 5 07:54:56 2011

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Enter user-name: system
Enter password:

Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
EdStevens
Rakesh wrote:
Hi,

echo$PATH gives me following output.


rakesh@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
So the directory containing sqlplus is not in your PATH . . .
rakesh@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin$ sqlplus
bash: sqlplus: command not found
rakesh@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin$ sqlplus "/ as sysdba"
bash: sqlplus: command not found



Do i have to restart the system if i edit/set ORACLE_HOME,SID,PATH parameters..??
i am able to access the OEM.
i have not installed any database.by default there was a database installed & named "XE".
when i open the "Run SQLCommand Line" from the Applications tab in ubuntu it displays the following output.

*/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found*
*/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found*

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 5 04:45:18 2011

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL>


Regards,
Rakesh

Edited by: user333 on Mar 5, 2011 6:13 PM
EdStevens
Rakesh wrote:
i tried giving the read,write,execute permissions to the sqlplus file.and it woked...!!

root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# ls -l sqlplus
-rwxr-xr-x 1 oracle dba 4228 2006-02-24 12:42 sqlplus
root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# chmod 777 sqlplus
root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# ls -l sqlplus
-rwxrwxrwx 1 oracle dba 4228 2006-02-24 12:42 sqlplus
root@ubuntu:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin# sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 5 07:54:56 2011

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Enter user-name: system
Enter password:

Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
I can't help but think you are mis-interpreting your results. You already had read-execute permissions. Shouldn't need write permissions. I see you were doing all this as 'root'. You should never use 'root' to do oracle dba work.

My sqlplus is effectively in the same directory as yours ...
[oracle@vmlnx01 ~]$ which sqlplus
/ora00/app/oracle/product/10.2.0/db_1/bin/sqlplus
and has the same permissions as yours before you did the chmod ...
[oracle@vmlnx01 ~]$ ls -l /ora00/app/oracle/product/10.2.0/db_1/bin/sqlplus
-rwxr-xr-x 1 oracle oinstall 8708 Jul 14  2010 /ora00/app/oracle/product/10.2.0/db_1/bin/sqlplus
and yet I am able to start it with no problems. So no, the chmod 777 was not the controlling factor
[oracle@vmlnx01 ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.4.0 - Production on Sat Mar 5 22:12:11 2011

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

SQL>
If you want to learn something from this, you'll find the root cause of your problem and fix that. I'd start by logging on to the OS as oracle (not root) and issuing the following:
env | grep ORA | sort
id
1 - 10
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 2 2011
Added on Mar 5 2011
10 comments
2,931 views