linux中oracle的环境变量设置问题(sqlplus执行不了)

程度深 2015-12-08 06:53:25
[size=13px]在虚拟机中安装了linux系统,并在此系统中安装了oracle。
打开terminal,执行命令 sqlplus ,发现错误如下

bash: sqlplus: command not found

在网上搜索相关问题的答案,发现是oracle的环境变量设置问题

在/home/oracle/ 中的文件 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/oracle;export ORACLE_BASE
ORACLE_HOME =$ORACLE_BASE/product/10.2.0/db_1;export ORACLE_HOME
ORACLE_SID =orcl;export ORACLE_SID
PATH=/usr/sbin:$PATH;export PATH
PATH=$ORACLE_HOME/bin:$PATH;export PATH;


~
~
~
~
~
~
~
".bash_profile" 16L, 370C




然后重启

还是不行的

直接进入bin目录执行
[oracle@localhost ~]$ cd /home/oracle/oracle/product/10.2.0/db_1/bin
[oracle@localhost bin]$ ./sqlplus


错误如下:
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




用echo查询$ORACLE_HOME 页没有反应



网上查了好多都找不到相关办法。。各位大侠帮帮忙啊
[/size]
...全文
2471 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
程度深 2015-12-08
  • 打赏
  • 举报
回复
原因找到了
程度深 2015-12-08
  • 打赏
  • 举报
回复
引用 1 楼 wildwave 的回复:
设置好以后,source .bash_profile 生效
env|grep ORA
查看环境变量


谢谢您的回复
安装你的建议执行命令


还是没有发现命令,可是我明明已经再bash_profile中设置了啊
小灰狼W 2015-12-08
  • 打赏
  • 举报
回复
设置好以后,source .bash_profile 生效 env|grep ORA 查看环境变量

3,491

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 高级技术相关讨论专区
社区管理员
  • 高级技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧