弄了半天都没解决的问题,希望哪位大侠帮忙看一下
我现在在vm上们装了一个redhat as4.0,刚刚装了一个oralce10g,装的过程中也没碰到什么错误,但是现在想用sqlplus的时候碰到了问题,刚开始用的时候不管用什么用户都是提示:
bash: sqlplus: command not found
后来在oracle用户下面执行了下面的命令
chmod -R a+rX /usr/oracle/product/10.2.0/db_1
再在oracle用户下面输入sqlplus时,报了下面的错误
[oracle@server ~]$ sqlplus
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Jul 6 00:48:15 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter user-name: scott
Enter password:
ERROR:
ORA-01034: Message 1034 not found; No message file for product=RDBMS,
facility=ORA
ORA-27101: Message 27101 not found; No message file for product=RDBMS,
facility=ORA
Linux Error: 2: No such file or directory
在其他用户下面包括root用户下还是报这个错误
[root@server /]# sqlplus
-bash: sqlplus: command not found
在网上查了半天,大都说是环境变量有问题,我oracle用户下面的.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
# Oracle Settings
TMP=/tmp;
export TMP
TMPDIR=$TMP;
export TMPDIR
ORACLE_BASE=oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=orcl
ORACLE_TERM=xterm
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH ORACLE_TERM
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
oracle安装路径如下:
[oracle@server db_1]$ pwd
/home/oracle/oracle/product/10.2.0/db_1
[oracle@server db_1]$ ls -l
total 492
drwxr-xr-x 3 oracle dba 4096 Jul 5 17:01 admin
drwxr-xr-x 7 oracle dba 4096 Jul 5 16:38 assistants
drwxrwxr-x 2 oracle dba 12288 Jul 5 17:00 bin
drwxr-xr-x 3 oracle dba 4096 Jul 5 16:45 cdata
drwxr-xr-x 7 oracle dba 4096 Jul 5 18:29 cfgtoollogs
drwxr-xr-x 4 oracle dba 4096 Jul 5 16:38 clone
drwxr-xr-x 2 oracle dba 4096 Jul 5 16:45 config
drwxr-xr-x 6 oracle dba 4096 Jul 5 16:38 crs
drwxr-xr-x 7 oracle dba 4096 Jul 5 16:45 css
drwxr-xr-x 10 oracle dba 4096 Jul 5 16:45 ctx
drwxr-xr-x 2 oracle dba 4096 Jul 5 17:29 dbs
drwxr-xr-x 3 oracle dba 4096 Jul 5 16:38 demo
drwxr-xr-x 3 oracle dba 4096 Jul 5 16:38 diagnostics
drwxr-xr-x 3 oracle dba 4096 Jul 5 17:05 flash_recovery_area
drwxr-xr-x 3 oracle dba 4096 Jul 5 16:38 has
drwxr-xr-x 6 oracle dba 4096 Jul 5 17:00 hs
drwxr-xr-x 5 oracle dba 4096 Jul 5 17:39 install
-rw-r--r-- 1 oracle dba 37 Jul 5 16:38 install.platform
drwxr-xr-x 12 oracle dba 4096 Jul 5 17:00 inventory
drwxr-xr-x 7 oracle dba 4096 Jul 5 16:38 javavm
drwxr-xr-x 4 oracle dba 4096 Jul 5 16:44 jdbc
drwxr-xr-x 7 oracle dba 4096 Jul 5 16:44 jdk
drwxr-xr-x 2 oracle dba 4096 Jul 5 16:45 jlib
drwxr-xr-x 3 oracle dba 4096 Jul 5 16:38 jre
drwxr-xr-x 13 oracle dba 4096 Jul 5 16:45 ldap
drwxr-xr-x 3 oracle dba 12288 Jul 5 17:00 lib
drwxr-xr-t 3 oracle dba 4096 Jul 5 17:01 log
drwxr-xr-x 6 oracle dba 4096 Jul 5 16:38 md
drwxr-xr-x 2 oracle dba 4096 Jul 5 16:40 mesg
drwxr-xr-x 7 oracle dba 4096 Jul 5 16:45 mgw
drwxr-xr-x 11 oracle dba 4096 Jul 5 17:00 network
drwxr-xr-x 6 oracle dba 4096 Jul 5 16:38 nls
drwxr-xr-x 15 oracle dba 4096 Jul 5 17:00 oc4j
drwxr-xr-x 6 oracle dba 4096 Jul 5 16:38 odbc
drwxr-xr-x 5 oracle dba 4096 Jul 5 16:38 olap
drwxr-xr-x 4 oracle dba 4096 Jul 5 16:45 OPatch
drwxr-xr-x 7 oracle dba 4096 Jul 5 16:45 opmn
drwxr-xr-x 4 oracle dba 4096 Jul 5 16:38 oracore
-rw-r--r-- 1 oracle dba 55 Jul 5 16:36 oraInst.loc
drwxr-xr-x 8 oracle dba 4096 Jul 5 16:38 ord
drwxr-xr-x 7 oracle dba 4096 Jul 5 16:45 oui
drwxr-xr-x 4 oracle dba 4096 Jul 5 16:38 owm
drwxr-xr-x 6 oracle dba 4096 Jul 5 16:38 perl
drwxr-xr-x 7 oracle dba 4096 Jul 5 16:39 plsql
drwxr-xr-x 7 oracle dba 4096 Jul 5 16:38 precomp
drwxr-xr-x 7 oracle dba 4096 Jul 5 16:45 racg
drwxr-xr-x 13 oracle dba 4096 Jul 5 17:00 rdbms
drwxr-xr-x 4 oracle dba 4096 Jul 5 16:44 relnotes
-rwxr-xr-x 1 oracle dba 9530 Jul 5 17:00 root.sh
-rwxr-xr-x 1 oracle dba 0 Jun 7 2005 root.sh.old
drwxr-xr-x 3 oracle dba 4096 Jul 5 17:34 server.liuhai.com_orcl
drwxr-xr-x 3 oracle dba 4096 Jul 5 16:38 slax
drwxr-xr-x 3 oracle dba 4096 Jul 5 16:38 sqlj
drwxr-xr-x 9 oracle dba 4096 Jul 5 16:45 sqlplus
drwxr-xr-x 12 oracle dba 4096 Jul 5 16:45 srvm
drwxr-xr-x 12 oracle dba 4096 Jul 5 16:45 sysman
drwxr-xr-x 4 oracle dba 4096 Jul 5 16:38 uix
drwxr-xr-x 3 oracle dba 4096 Jul 5 16:38 wwg
drwxr-xr-x 6 oracle dba 4096 Jul 5 16:43 xdk
我的环境ORACLE_BASE设错了,应该是ORACLE_BASE=/home/oracle/oracle
这篇文章对我很有帮助,谢谢提问题的人!感谢!
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23466814/viewspace-630516/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/23466814/viewspace-630516/