-bash: /home/oracle: is a directory

安装oracle 11g过程中,创建oracle用户以及配置了.bash_profile文件后,退出oracle用户,然后重新su - oracle后出现:-bash: /home/oracle: is a directory

[pw@gg ~]$ su - oracle
Password: 
-bash: /home/oracle: is a directory

多次尝试切换到oracle均是如此,在google和baidu上搜索:-bash: /home/oracle: is a directory  ,情况均和我的不一样,未果。

分析原因,肯定是./bash_profile内环境变量哪里设置的不对导致的,以下为我的.bash_profile


[oracle@ydrh1 ~]$ vi .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

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR


export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0.3
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/opt/ogg
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
unset USERNAME
umask 022


alias 'sqlplus'='/usr/local/rlwrap/bin/rlwrap sqlplus'
alias 'rman'='/usr/local/rlwrap/bin/rlwrap rman'
alias 'ggsci'='/usr/local/rlwrap/bin/rlwrap /opt/ogg/ggsci'
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
".bash_profile" 30L, 1024C 已写入           


后来经发现在标红的~的位置有一行,也就是在vi命令模式,正常情况下光标是不能移动到红色~区域的,而现在能移动到那里,说明有问题,可能的原因是在编辑.bash_profile时格式上出现了点问题(因为我用SecureCRT工具登录的linux系统,字符集使用不对可导致vi时出现莫名其妙的情况)

解决:

[root@pw ~]# su - oracle

-bash: /home/oracle: is a directory

[oracle@pw ~]$ vi .bash_profile

命令模式下,将光标移动到红色~位置,用dd命令删除此行,然后:wq保存退出

[oracle@pw ~]$ exit

[root@pw ~]# su - oracle

[oracle@pw ~]$ 

现象消失了,问题解决了,从这事可以看出,导致的问题原因很微不足道,但有时候就总在微不足道的小问题上翻跟头,所以以后做事要细心了……

 

原文:http://blog.csdn.net/langkeziju/article/details/9369217

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值