Difference between su and su - in Linux

sahabcse

In Runtime
Messages
277
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
 
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.
 
Back
Top Bottom