SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory相关的知识,希望对你有一定的参考价值。

今天登录一台服务器用roote用户登录的,在切换到oracle用户,执行sqlplus sys/ as sysdba进入数据库提示如下错误:

SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory


在/home/oracle目录下查看文件.bash_profile,它是隐藏文件。

$ cat .bash_profile 
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/u01/app/oracle 
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH 
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
LANG=zh_CN.UTF-8; export LANG
NLS_LANG=‘SIMPLIFIED CHINESE_CHINA.AL32UTF8‘; export NLS_LANG

[[email protected] ~]$ cd $ORACLE_HOME

-bash: cd: /u01/app/oracle/product/11.1.0/db_1: 没有那个文件或目录


发现oracle安装定义的家目录是在/u01/app/oracle/product/11.1.0/db_1目录下的
u01目录是root用户的权限,在切回到root用户,执行如下命令:
[[email protected] ~]# cd $ORACLE_HOME
[[email protected] dbhome_1]# pwd
/u01/app/oracle/product/11.2.0/dbhome_1
[[email protected] dbhome_1]# sqlplus / as sysdba
或是
[[email protected] dbhome_1]# cd bin
[[email protected] dbhome_1]# pwd
/u01/app/oracle/product/11.2.0/dbhome_1/bin
[[email protected] bin]# ./sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 12 17:20:48 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Enter password: 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>

问题解决!


本文出自 “运维笔录 美玲” 博客,请务必保留此出处http://meiling.blog.51cto.com/6220221/1971801

以上是关于SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory的主要内容,如果未能解决你的问题,请参考以下文章

Failed to resolve loader: script-loader You may need to install it.

You may need to adjust the proxy settings in Gradle.

Avoid catching exceptions inside atomic! You may need to manually revert model state when rolling b

vue启动项目的报错:Failed to resolve loader: less-loader You may need to install it.

conda激活环境报错:IMPORTANT: You may need to close and restart your shell after running ‘conda init‘.

运行django项目出现Invalid HTTP_HOST header: '192.168.1.111:8000'. You may need to add '192.168