ITPUB论坛 » Oracle数据库管理 » 弄了半天都没解决的问题,希望哪位大侠帮忙看一下
新一届的微软MVP评选已经开始,欢迎各位推荐!
2008-7-6 00:27 lhlucky5516
弄了半天都没解决的问题,希望哪位大侠帮忙看一下

我现在在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
[b]drwxr-xr-x   9 oracle dba  4096 Jul  5 16:45 sqlplus[/b]
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

2008-7-6 00:48 五“宅”一生
最开始看见bash: sqlplus: command not found这样的错误时。你就应该考虑是不是环境变量中PATH设置的问题。起码你得用绝对路径看sqlplus命令是否正常。而不是去更改权限。

2008-7-6 02:50 anycall2010
ORACLE_BASE=oracle 改为ORACLE_BASE=/home/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 改为ORACLE_HOME=$ORACLE_BASE/home/product/10.2.0/db_1
看看怎样?呵呵

2008-7-6 09:06 John-dl
[quote]原帖由 [i]anycall2010[/i] 于 2008-7-6 02:50 发表 [url=http://www.itpub.net/redirect.php?goto=findpost&pid=10868719&ptid=1017402][img]http://www.itpub.net/images/common/back.gif[/img][/url]
ORACLE_BASE=oracle 改为ORACLE_BASE=/home/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 改为ORACLE_HOME=$ORACLE_BASE/home/product/10.2.0/db_1
看看怎样?呵呵 [/quote]
安装路径是:/home/oracle/oracle/product/10.2.0/db_1
所以应该:ORACLE_BASE=/home/oracle/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
是不是?

2008-7-6 09:14 howard_zhang
ORACLE_BASE=/home/oracle--------修改
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

2008-7-6 10:05 lhlucky5516
非常感谢各路神仙的帮助,问题基本解决,oracle_base配错了,应该是ORACLE_BASE=/home/oracle/oracle,然后启动一下oralce就可以了,但是现在还有一个小问题,用oracle用户可以登录上去了,用其他用户还是报-bash: sqlplus: command not found
是不是PATH设置的有问题,还是要去改变其他用户的.bash_profile?

2008-7-6 10:07 pulf
实际上很明显的path错误,有的时候花点时间分析错误还是对自己应该是提高。呵呵。

2008-7-6 10:22 John-dl
呵呵,其他用户要使用sqlplus,就要设置他们的path变量,或者他们的.bash_profile文件,然后source 一下.

2008-7-6 23:00 五“宅”一生
还有,其他用户得有dba权限,不然即使命令找到了也没有多大意义。

2008-7-7 09:07 muzijiang
没有必要让其他用户也使用sqlplus吧

2008-7-7 09:17 rollingpig
其它用户也要有这一段

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

2008-7-7 09:33 max123567
解决问题一定要有耐心

2008-7-7 10:16 javens
沒弄過Liunx的

2008-7-7 13:40 hoqingyuexiao
e, 又是环境变量配置不当的案例~~~

每个user对应自己的环境变量配置,配置在.bashrc 或者.bash_profile里面,这样在用户每次登陆的时候自动加载。

一般什么什么命令找不到都是环境变量没有配置好的原因,耐心点就会发现错误了:)

哎,主要是开始装oracle的时候也遇到很多类似的错误...

页: [1]


Powered by ITPUB论坛