您的位置:首页 > 数据库 > Oracle

oracle 环境变量没配置好,导致orapwd执行失败

2014-04-04 11:34 627 查看
今天有朋友执行orapwd命令,报错了,错误信息如下:

[oracle@oracle11g ~]$ orapwd file=/u01/oracle/product/11.2.0.1/db_home1/dbs/orapworcl password=oracle entries=30

-bash: orapwd: command not found

报错是说找不到命令,这种情况,一般是环境变量配置有问题,导致找不到命令,

我让他看一下.bash_profile文件,查得文件信息如下:

[oracle@oracle11g ~]$cat .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

export ORACLE_SID=ENMOEDU

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

export PATH=$ORACLE/bin:$ORACLE_HOME/jdk/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

alias sqlplus='rlwrap sqlplus'

alias rman='rlwrap rman'

...

问题找出来了,在上面的配置中,PATH环境变量配置不正确。

将上面的 $ORACLE/bin,更正为$ORACLE_HOME/bin之后,就正常了。

[oracle@oracle11g dbs]$ orapwd file=/u01/oracle/product/11.2.0.1/db_home1/dbs/orapworcl password=oracle
entries=30
[oracle@oracle11g dbs]$

没有返回信息,表示创建成功,来查看一下,看见了刚建的密码文件:

[oracle@oracle11g dbs]$ ls -l

total 28

-rw-rw---- 1 oracle oinstall 1544 Apr  1 09:03 hc_orcl.dat

-rw-r--r-- 1 oracle oinstall 2851 May 15  2009 init.ora

-rw-r----- 1 oracle oinstall   24 Dec  5 17:00 lkORCL
-rw-r----- 1 oracle oinstall 1536 Dec  5 17:04 orapworcl

-rw-r----- 1 oracle oinstall 3584 Apr  1 03:00 spfileorcl.ora

orapwd命令的详细使用说明,可参考我的另一篇博文:
http://blog.csdn.net/hollo_hhy/article/details/22939509
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐