赞
踩
$ sqlplus / as sysdba
-bash: sqlplus: command not found
查看当前环境变量配置
$ echo $ORACLE_BASE
/oracle/app
$ echo $ORACLE_HOME
/oracle/app/product/12.1.0/dbhome_1
查看软件安装路径为
/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
将.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>
问题已处理
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。