Computer Forums

Computer Forums (http://www.computerforums.org/forums/)
-   Server Administration (http://www.computerforums.org/forums/server-administration/)
-   -   Difference between su and su - in Linux (http://www.computerforums.org/forums/server-administration/difference-between-su-su-linux-212288.html)

sahabcse 07-27-2011 03:43 AM

Difference between su and su - in Linux
 
Today I have run the command

"su oracle" in my DB server, that time dbstart command is not running fine.
After that I have tried using "su - oracle", that time it start without making any issue.

Please let me why oracle not started, Any idea

root 07-27-2011 07:17 AM

Re: Difference between su and su - in Linux
 
su (Unix) - Wikipedia, the free encyclopedia

that article describes it.

using su oracle will log you in as the oracle user, you switch from being root to being the oracle user.

using su - oracle logs you in as the root user assuming the oracle users environment. (e.g. you're still root but you have access to their environment).

so, su oracle means that you're the oracle user, whom I assume is not a root user, so you can't execute dbstart.
su - oracle logs you in as root within the oracle users environment.

you can issue dbstart as you are root, and because you're assuming the oracle users environment all the variables/paths etc are such that the program starts successfully.


All times are GMT -5. The time now is 05:25 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0