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,它是隐藏文件。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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

[oracle@localhost ~]$ cd $ORACLE_HOME

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


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
发现oracle安装定义的家目录是在/u01/app/oracle/product/11.1.0/db_1目录下的
u01目录是root用户的权限,在切回到root用户,执行如下命令:
[root@localhost ~]# cd $ORACLE_HOME
[root@localhost dbhome_1]# pwd
/u01/app/oracle/product/11.2.0/dbhome_1
[root@localhost dbhome_1]# sqlplus / as sysdba
或是
[root@localhost dbhome_1]# cd bin
[root@localhost dbhome_1]# pwd
/u01/app/oracle/product/11.2.0/dbhome_1/bin
[root@localhost 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>

问题解决!


      本文转自ling118 51CTO博客,原文链接:http://blog.51cto.com/meiling/1971801,如需转载请自行联系原作者

相关文章
eggjs 项目报错 Cookie need secret key to sign and encrypt. Please set config.keys first
eggjs 项目报错 Cookie need secret key to sign and encrypt. Please set config.keys first
287 0
eggjs 项目报错 Cookie need secret key to sign and encrypt. Please set config.keys first
|
4月前
|
开发工具 git
If you are using the git profile, you need to set a Git URI in your configuration. If you are using
If you are using the git profile, you need to set a Git URI in your configuration. If you are using
107 0
|
4月前
|
API Python Windows
[已解决] openai.error.AuthenticationError: No API key provided. You can set your API key in code using
[已解决] openai.error.AuthenticationError: No API key provided. You can set your API key in code using
348 0
|
Java Nacos 开发者
Nacos无法启动详解:Please set the JAVA_HOME variable in your environment, We need java(x64) jdk8 or later
Nacos无法启动详解:Please set the JAVA_HOME variable in your environment, We need java(x64) jdk8 or later
2473 1
|
JavaScript 前端开发
.bezierEasingMixin(); ^ Inline JavaScript is not enabled. Is it set in your op..
.bezierEasingMixin(); ^ Inline JavaScript is not enabled. Is it set in your op..
190 0
|
Java Maven
Error running ‘ssm [clean]‘: No valid Maven installation found. Either set the home directory in the
Error running ‘ssm [clean]‘: No valid Maven installation found. Either set the home directory in the
111 0
|
关系型数据库 MySQL 数据库
DataGrip 2020.1连接数据库报错 Server returns invalid timezone. Need to set‘serverTimezone’property
DataGrip 2020.1连接数据库报错 Server returns invalid timezone. Need to set‘serverTimezone’property
223 0
DataGrip 2020.1连接数据库报错 Server returns invalid timezone. Need to set‘serverTimezone’property
|
数据库
Server returns invalid timezone. Need to set ‘serverTimezone‘ property.(idea连接数据库报错)
Server returns invalid timezone. Need to set ‘serverTimezone‘ property.(idea连接数据库报错)
132 0
Server returns invalid timezone. Need to set ‘serverTimezone‘ property.(idea连接数据库报错)
|
Java Maven
No valid Maven installation found. Either set the home directory in the configuration dialog or set
No valid Maven installation found. Either set the home directory in the configuration dialog or set
834 0
No valid Maven installation found. Either set the home directory in the configuration dialog or set
|
Java
Gradle ERROR: JAVA_HOME is set to an invalid directory: D:\Software\Java\JDK9.0.4;异常处理
Gradle ERROR: JAVA_HOME is set to an invalid directory: D:\Software\Java\JDK9.0.4;异常处理
479 0
Gradle ERROR: JAVA_HOME is set to an invalid directory: D:\Software\Java\JDK9.0.4;异常处理