有多少错误可以重犯呢?
看一下我Oracle用户的.bash_profile有什么问题没有?
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
ORACLE_BASE=/opt/oracle/product
ORACLE_HOME=/opt/oracle/product/10g
LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib;export LD_LIBRARY_PATH
LIBPATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib;export LIB_PATH
CLASSPATH=$ORACLE_HOME/JRE/lib:$ORACLE_HOME/JRE/lib/rt.jar:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;export CLASSPATH
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export PATH
unset USERNAME
貌似一切正常,可正当我做如下操作的时候:
[root@orahost01 ~]# su - oracle
[oracle@orahost01 ~]$ export ORACLE_SID=ASM
[oracle@orahost01 ~]$ sqlplus /nolog
Error 6 initializing SQL*Plus
Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
Oracle报错了。
很以外的的,我又登陆一次,成功了。但是在启动instance的时候又报如下错误:
[oracle@orahost01 10g]$ clear
[oracle@orahost01 10g]$ export ORACLE_SID=ASM
[oracle@orahost01 10g]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 31 18:45:43 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn / as sysdba;
ERROR:
ORA-09925: Message 9925 not found; No message file for product=RDBMS,
facility=ORA
Linux Error: 2: No such file or directory
Additional information: 9925
ORA-09925: Message 9925 not found; No message file for product=RDBMS,
facility=ORA
Linux Error: 2: No such file or directory
Additional information: 9925
查了一下$ORACLE_HOME/rdbms目录
[oracle@orahost01 10g]$ ls -l rdbms
total 80
drwxr-x--- 2 oracle oinstall 36864 Dec 31 18:01 admin
drwxr-x--- 2 oracle oinstall 4096 Dec 31 18:54 audit
drwxr-x--- 2 oracle oinstall 4096 Dec 31 17:59 demo
drwxr-x--- 2 oracle oinstall 4096 Dec 31 17:58 doc
drwxr-x--- 4 oracle oinstall 4096 Dec 31 18:01 install
drwxr-x--- 2 oracle oinstall 4096 Dec 31 17:58 jlib
-rw-r----- 1 oracle oinstall 24 Jun 30 2005 label.info
drwxr-x--- 2 oracle oinstall 4096 Dec 31 18:01 lib
drwxr-x--- 2 oracle oinstall 4096 Dec 31 17:59 log
drwxr-x--- 2 oracle oinstall 4096 Dec 31 17:58 mesg
drwxr-x--- 2 oracle oinstall 4096 Dec 31 17:58 public
drwxr-x--- 3 oracle oinstall 4096 Dec 31 17:57 xml
audit和mesg都是存在切可写的,那为什么还会报错呢?
问题其实已经暴露在我们的.bash_profile中了。主要就是
ORACLE_HOME=/opt/oracle/product/10g
这个环境变量没有被export,因此此变量是不能被shell的子进程获得的。
改为ORACLE_HOME=/opt/oracle/product/10g;export ORACLE_HOME
问题得到了圆满的解决。
由于忽略了export,会引出这些奇怪的现象发生,诶?我确实设置了ORACLE_HOME,了但是为什么还是有这样的提示呢?
做为DBA,应该时刻注意自己的每一步操作,更重要的是要谨慎注意每一处的细节!