一、问题描述
在linux中oracle安装成功后,首次启动使用时,出现 sqlplus 命令不识别的问题,现象如下:
$ sqlplus / as sysdba bash: sqlplus: command not found...
二、问题分析
查看环境变量是否正确配置:
$ vim .bash_profile
.bash_profile文件内容如下:
# .bash_profile # get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # user specific environment and startup programs path=$path:$home/.local/bin:$home/bin export path export oracle_sid=orclcdb export oracle_base=/opt/oracle export oracle_home=$oracle_base/product/19c/dbhome_1
发现path环境变量没有正确配置,于是执行如下操作:
在最后添加如下内容:
export path=$path:$oracle_home/bin
然后执行命令使生效:
$ source .bash_profile
或
$ . .bash_profile
三、效果验证
再次尝试登录,发现可正常登录,示例效果如下:
$ sqlplus / as sysdba sql*plus: release 19.0.0.0.0 - production on fri mar 15 22:18:23 2024 version 19.3.0.0.0 copyright (c) 1982, 2019, oracle. all rights reserved. connected to: oracle database 19c enterprise edition release 19.0.0.0.0 - production version 19.3.0.0.0 sql>
总结
到此这篇关于linux中oracle安装后bash: sqlplus: command not found问题解决方法的文章就介绍到这了,更多相关bash: sqlplus: command not found问题内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!
发表评论