弄了半天都没解决的问题,希望哪位大侠帮忙看一下
我现在在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 ~]$ sqlplusSQL*Plus: Release 10.2.0.1.0 - Production on Sun Jul 6 00:48:15 2008Copyright (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 programsPATH=$PATH:$HOME/binexport PATH
unset USERNAME# Oracle Settings
TMP=/tmp;
export TMP
TMPDIR=$TMP;
export TMPDIRORACLE_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_TERMif [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fioracle安装路径如下:
[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

解决方案 »

  1.   

    [oracle@rac2 ~]$ sqlplus /nologSQL*Plus: Release 9.2.0.4.0 - Production on Sun Jul 6 01:47:33 2008Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.SQL> conn / as sysdba
    Connected.
    SQL> select * from dual;D
    -
    XSQL> [oracle@rac2 ~]$ more .bash_profile
    # .bash_profile# Get the aliases and functions
    if [ -f ~/.bashrc ]; then
            . ~/.bashrc
    fi# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATH
    unset USERNAME
    export LD_ASSUME_KERNEL=2.4.1
    export ORACLE_BASE=/oracle
    export ORACLE_HOME=/oracle/product/9.2.0
    export ORACLE_SID=fadb
    export ORACLE_TERM=xterm
    export NLS_LANG=AMERICAN
    export ORACLE_OWNER=oracle
    export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data 
    export THREADS_FLAG=native
    export LD_LIBRARY_PATH=/oracle/product/9.2.0/lib:/lib:/usr/lib:/usr/local/lib
    export PATH=/oracle/product/9.2/bin:$PATH 
    export PATH=$PATH:$ORACLE_HOME/bin 
    CLASSPATH=$CLASSPATH:$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
    CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
    export  CLASSPATH
      

  2.   

    非常感谢这位大侠,问题基本解决了,我的环境ORACLE_BASE设错了,应该是ORACLE_BASE=/home/oracle/oracle
    然后把数据库启动起来就可以了,但是现在还有一个小问题,用oracle用户可以连上了,但是用其他用户还是bash: sqlplus: command not found 
    是不是PATH哪边设的有问题,还是要去该root下面的.bash_profile?
      

  3.   

    只能用操作系统的oracle用户进行数据库的相关操作。
      

  4.   

    如果是非oracle 用户,需要将$ORACLE_BASE 的目录权限放开。