Go Back   Computer Forums > General Computing > Server Administration
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 07-27-2011, 03:43 AM   #1
In Runtime
Join Date: Jan 2011
Posts: 277
Default 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

sahabcse is offline   Reply With Quote
Old 07-27-2011, 07:17 AM   #2
Site Team
root's Avatar
Join Date: Mar 2004
Posts: 7,872
Default 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.
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 03:05 AM.

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