前几天在centos6.0上配好了oracle 10g并且能够执行oracle相关命令,但是今天准备往oracle里倒数据时,执行sqlplus 出现bash:command not found

[oracle@master ~]$ sqlplus /nolog
bash: sqlplus: command not found

然后google了下,是/usr/bin找不到sqlplus命令,然后对$ORACLE_HOME/bin/sqlplus在/usr/bin下建立连接

[oracle@master ~]$ ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
[oracle@master ~]$ sqlplus /nolog
bash: sqlplus: command not found

还是出现找不到命令,用which sqlplus

[oracle@master ~]$ which sqlplus
/usr/bin/which: no sqlplus in (/home/env/hbase0946/bin:/usr/java/jdk1..0_43/bin:/home/env/ant190/bin:/home/env/maven305/bin:/home/env/hadoop112/bin:/home/env/zookeeper345/bin:/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

查询结果可知$PATH中没有包含到$ORACLE_HOME/bin,既然找到了原因那就好办了。

[oracle@master ~]$ vi .bash_profile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs ORACLE_BASE=/home/oracle/oracle10g
ORACLE_HOME=$ORACLE_BASE/
ORACLE_SID=orcl
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

在.bash_profile 中PATH已经包含了$ORACLE_HOME/bin,那就是说明我的profile没有起作用。

[oracle@master ~]$ source .bash_profile
[oracle@master ~]$ sqlplus /nolog SQL*Plus: Release 10.2.0.1. - Production on Thu Dec :: Copyright (c) , , Oracle. All rights reserved. SQL>

让我费解的地方是安装完oracle的时候我已经source .bash_profile并且sqlplus这些命令是有用的,只是过了几天重开终端再执行时就失效了,我并没有重启linux

bash:xxx:command not found的更多相关文章

  1. Linux下提示 bash: xxx command not found

    今天在虚拟机上安装了CentOS5.5,发现运行一些很正常的诸如:init,shutdown,fdisk 等命令时,悍然提示: bash: xxx command not found. 那么,首先就要 ...

  2. linux命令存放 bash: xxx command not found

    参考资料:http://blog.sina.com.cn/s/blog_688077cf01013qrk.html 提示:bash: xxx command not found 首先就要考虑root ...

  3. centos下一个bash: XXX: command not found解决方案

    最近想centos通过做Android工程建设.配置jdk和Android sdk后,也同时/etc/profile将java和Android环境变量配置成,但它不能像windows 在相同,直接使用 ...

  4. 关于su下bash:xxx :command not found

    今天在新建组的时候出了问题: $ su Password: # groupadd prj bash: groupadd :command not found 我就纳闷,明明是在su权限下,怎么还不能使 ...

  5. bash: ./xxx 权限不够

    Linux环境下要运行C编译的一个可执行文件play,终端cd到当前目录后输入./play,提示  bash: ./xxx 权限不够 用sudo, 提示 sudo:./play: command no ...

  6. bash: hexo: command not found

    问题 很久没写博客了,今天用hexo新建文章时git报错: bash: hexo: command not found 解决办法 百度之后,将D:\WorkingSoftware\GithubBlog ...

  7. scp报错 -bash: scp: command not found

    环境:RHEL6.5 使用scp命令报错: [root@oradb23 media]# scp /etc/hosts oradb24:/etc/ -bash: scp: command not fou ...

  8. source /etc/profile报错-bash: id:command is not found

    由于误操作导致 source /etc/profile 报错 -bash: id:command is not found 此时,linux下很多命令到不能能用,包括vi ls 等... 可以使用 e ...

  9. -bash: .bash_profile: command not found

    今天有一同事安装了ORACLE后,在切换账号时遇到错误提示"-bash: .bash_profile: command not found".如下所示 [root@GLETestL ...

随机推荐

  1. tpopela/vips_java

    tpopela/vips_java Implementation of Vision Based Page Segmentation algorithm in Java

  2. TCP的核心系列 — SACK和DSACK的实现(一)

    TCP的实现中,SACK和DSACK是比较重要的一部分. SACK和DSACK的处理部分由Ilpo Järvinen (ilpo.jarvinen@helsinki.fi) 维护. tcp_ack() ...

  3. js 定义类对象

    //定义类     //方式一     function A_class(arg1,arg2){         this.arg1=arg1;         this.arg2=arg2;     ...

  4. Swift和Objective-C混合编程

    假设你现在就是一个iOS程序员,你对Objective-C很熟悉,对iOS开发也很熟悉,然而,苹果公司在iOS 8之后推出了Swift语言.那么,如何才能快速地从Objective-C过渡到Swift ...

  5. Node.js笔记4

    4. 文件系统 fs fs模块是文件操作的封装,提供了同步跟异步操作2个版本 * fs.readFile(filename,[encoding],[callback(err,data)]) 是最简单的 ...

  6. ASP.NET -- repeater控件的使用

    转载自网络-原网址[http://blog.csdn.net/haitaodoit/article/details/7021214] repeater绑定数据: protected void Page ...

  7. unity 播放外部视频

    摘要: Unity支持的播放视频格式有.mov..mpg..mpeg..mp4..avi和.asf.只需将对应的视频文件拖拽入Project视图即可,它会自动生成对应的MovieTexture对象. ...

  8. objective-C学习笔记(八) 集合类型 Collection Types

    OBJC的集合类型: 1.数组 Array 2.Set 3.键值对 Dictionary 数组:OC中的数组被定义为class,引用类型.索引从0开始,访问越界会抛出运行时异常. NSArray的元素 ...

  9. Symfony框架系列----常用命令

    一.常用命令 从Entity操作数据库: app/console doctrine:database:create # 创建数据库 app/console doctrine:schema:update ...

  10. [LeetCode]题解(python):127-Word Ladder

    题目来源: https://leetcode.com/problems/word-ladder/ 题意分析: 和上一题目类似,给定一个beginWord和一个endWord,以及一个字典list.这题 ...