bash: sqlplus: command not found问题的解决方法
时间:2014-12-05 02:02 来源:linux.it.net.cn 作者:IT
在linux中,遇到这样的问题:bash: sqlplus: command not found,本文分享下相关解决方法。
bash环境是配置没错的, 但就是报错:
[root@itnetcn ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
export EDITOR=vi
export ORACLE_SID=dg1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export PATH=/u01/app/oracle/product/10.2.0/db_1/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
export PATH=$ORACLE_HOME/bin:$PATH
umask 022
解决方法:
[root@itnetcn ~]$ sqlplus /nolog
bash: sqlplus: command not found
[root@itnetcn ~]$ ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
ln: creating symbolic link `/usr/bin/sqlplus' to `/bin/sqlplus': Permission deni ed
[root@itnetcn ~]$ su - root
Password:
[root@dg1 ~]# ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
[root@dg1 ~]# su - oracle
[root@itnetcn ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Mon May 11 12:51:24 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 79694068 bytes
Database Buffers 83886080 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
(责任编辑:IT)
在linux中,遇到这样的问题:bash: sqlplus: command not found,本文分享下相关解决方法。
bash环境是配置没错的, 但就是报错:
[root@itnetcn ~]$ vi .bash_profile
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH unset USERNAME export EDITOR=vi export ORACLE_SID=dg1 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib export PATH=/u01/app/oracle/product/10.2.0/db_1/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin export PATH=$ORACLE_HOME/bin:$PATH umask 022
解决方法:
[root@itnetcn ~]$ sqlplus /nolog
bash: sqlplus: command not found [root@itnetcn ~]$ ln -s $ORACLE_HOME/bin/sqlplus /usr/bin ln: creating symbolic link `/usr/bin/sqlplus' to `/bin/sqlplus': Permission deni ed [root@itnetcn ~]$ su - root Password: [root@dg1 ~]# ln -s $ORACLE_HOME/bin/sqlplus /usr/bin [root@dg1 ~]# su - oracle [root@itnetcn ~]$ sqlplus /nolog SQL*Plus: Release 10.2.0.1.0 - Production on Mon May 11 12:51:24 2009 Copyright (c) 1982, 2005, Oracle. All rights reserved. SQL> conn / as sysdba Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 167772160 bytes Fixed Size 1218316 bytes Variable Size 79694068 bytes Database Buffers 83886080 bytes Redo Buffers 2973696 bytes Database mounted. Database opened. |