ITPub博客

首页 > 数据库 > Oracle > 环境变量设置错误导致sqlplus 连接不上oracle

环境变量设置错误导致sqlplus 连接不上oracle

原创 Oracle 作者:e71hao 时间:2016-05-10 14:52:57 0 删除 编辑
碰到一个奇怪的问题:在操作系统用户下oracle 下,我用sqlplus / as sysdba 命令连接不上去,如下:
[oracle@gridrac1 ~]$ export ORACLE_SID=apple01
[oracle@gridrac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue May 10 14:02:55 2016
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> 
但是我查看进程存在。
[oracle@gridrac1 ~]$ ps -ef|grep apple01
oracle    6073     1  0 14:03 ?        00:00:00 ora_pmon_apple01
oracle    6075     1  0 14:03 ?        00:00:00 ora_psp0_apple01
oracle    6077     1  2 14:03 ?        00:00:35 ora_vktm_apple01
oracle    6081     1  0 14:03 ?        00:00:00 ora_gen0_apple01
oracle    6083     1  0 14:03 ?        00:00:00 ora_diag_apple01
oracle    6085     1  0 14:03 ?        00:00:00 ora_dbrm_apple01

设置了很多环境变量,仍然是提示“Connected to an idle instance”。百撕不得姐呀

最后我对比了能够正常使用sqlplus 的主机的环境,发现我的ORACLE_HOME变量多了一个斜杠'/'.我原来是这样写的:
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1/
改成:
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
好了,问题解决了,就能够连接上sqlplus 了。什么原因?


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30393770/viewspace-2097112/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-08-05

  • 博文量
    133
  • 访问量
    235556