当前位置:   article > 正文

-bash: sqlplus: command not found

bash: sqlplus: command not found
问题描述:
$ sqlplus / as sysdba
-bash: sqlplus: command not found
  • 1
  • 2
原因定位:

查看当前环境变量配置

$ echo $ORACLE_BASE
/oracle/app
$ echo $ORACLE_HOME
/oracle/app/product/12.1.0/dbhome_1
  • 1
  • 2
  • 3
  • 4

查看软件安装路径为
/oracle/app/oracle/product/12.1.0/dbhome_1

所以,原因可能是环境变量配置有误。

处理方法:
$ su - oracle
Password:
Last login: Mon Sep  6 10:14:01 CST 2021 on pts/0
$ vi .bash_profile
  • 1
  • 2
  • 3
  • 4

将.bash_profile文件中的内容做如下修改:
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1
修改成:
export ORACLE_HOME=$ORACLE_BASE/oracle/product/12.1.0/dbhome_1

$ env | grep ORA
ORACLE_SID=wind2
ORACLE_BASE=/oracle/app
ORACLE_HOME=/oracle/app/product/12.1.0/dbhome_1

$ su - oracle
Password:
Last login: Mon Sep  6 10:21:05 CST 2021 on pts/0
$ env | grep ORA
ORACLE_SID=wind2
ORACLE_BASE=/oracle/app
ORACLE_HOME=/oracle/app/oracle/product/12.1.0/dbhome_1

--再次尝试连接(成功)
$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Mon Sep 6 10:24:07 2021

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26

问题已处理

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/444967
推荐阅读
相关标签
  

闽ICP备14008679号