su oracle 和 su - oracle的区别
来源:互联网 发布:爱优软件 编辑:程序博客网 时间:2024/05/24 08:33
一、症状
在启动oracle数据库时,报了这个错:
[oracle@ltdit3 ~]$ ./startOracle.sh startStarting Oracle:LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 27-JUN-2013 10:20:45Copyright (coffee) 1991, 2009, Oracle. All rights reserved.TNS-01106: Listener using listener name LISTENER has already been startedSQL*Plus: Release 11.2.0.1.0 Production on Thu Jun 27 10:20:45 2013Copyright (c) 1982, 2009, Oracle. All rights reserved.SQL> Connected to an idle instance.SQL> ORA-01078: failure in processing system parametersLRM-00109: could not open parameter file '/opt/oracle/112/dbs/initorcaleexport.ora'SQL> DisconnectedOK
二、原因
注意其中这句话:
SQL> ORA-01078: failure in processing system parametersLRM-00109: could not open parameter file '/opt/oracle/112/dbs/initorcaleexport.ora'
还原启动过程,发现执行者用的是su oracle切换到oracle用户,查了一下资料,su oracle 和 su - oracle是有区别的:
-, -l ,--login make the shell a login shell
加了"-",是以login shell登陆的,所以会设置环境变量,如果不加,使用的还是切换前用户的环境变量,所以会出错。
[oracle@ltdit3 ~]$ su --helpUsage: su [OPTION]... [-] [USER [ARG]...]Change the effective user id and group id to that of USER. -, -l, --login make the shell a login shell -c, --command=COMMAND pass a single COMMAND to the shell with -c --session-command=COMMAND pass a single COMMAND to the shell with -c and do not create a new session -f, --fast pass -f to the shell (for csh or tcsh) -m, --preserve-environment do not reset environment variables -p same as -m -s, --shell=SHELL run SHELL if /etc/shells allows it --help display this help and exit --version output version information and exitA mere - implies -l. If USER not given, assume root.Report bugs to <bug-coreutils@gnu.org>.[oracle@ltdit3 ~]$
三、解决方法
用su - oracle 取代 su oracle就可以了。
四、总结
1、做事要细心。
2、遇到问题多问一个为什么。
开始用户报错给我的时候,直接就在本地解决了,之后突发奇想,为什么用户那里会报错,过去看了一下,发现问题所在,就在一个“-”上,打了一下su --help,就知道加和不加的原因了。
- su oracle 和 su - oracle的区别
- su - oracle和su oracle的区别
- su oracle和su - oracle的区别
- su oracle 和 su
- su 和su -的区别
- su和su -的区别
- su和su -的区别
- su和su - 的区别
- su 和 su - 的区别:
- su 和su -的区别
- su和su - 区别
- su和su - 区别
- su user 和 su - user的区别
- su - root 和 su root 的区别
- su root 和su - root 的区别
- su 和 sudo su 的区别
- su root 和su - root 的区别
- su root 和su - root 的区别
- Flash制作简单塔防游戏(一)
- Hash函数
- c/c++ 算法之快速排序法 冒泡排序法,选择排序法,插入排序法
- CentOS 网络设置修改
- 在Eclipse中安装Freemarker插件
- su oracle 和 su - oracle的区别
- HDU 1501 Zipper 动态规划经典
- 安装Red Hat Linux 9.0,所遇错误问题的解决方法
- 流行的开源分布式文件系统比较
- java中的native
- 硬件
- 在 Linux RedHatEL6 环境下安装配置 JDK1.7 + Tomcat7.0 + MySQL5.6
- python换行符
- [leetcode]Longest Consecutive Sequence