I currently have a working version of SAP on my server with an Oracle database. In the csh bash shell everything works wonderfully, but during the installation process there is a step where the bash shell has to be changed to sh. My goal is to do the entire process in the sh shell for simplicity. The major issue is that the ORACLE_HOME environment variable is never set automatically when using the sh shell. I have manualy set the variable with the commands ORACLE_HOME=/oracle/<SID>/102_64;export ORACLE_HOME but this is not something that I wish to do every time I want to start SAP. I have tried to mannualy run the .dbenv_<hostname>.sh, which did not solve the problem. Then I wrote my own script just to set the ORACLE_HOME variable, which only sets the variables for when the script is running. What has to be changed so that the environment variables stay after a script in sh runs?
Thanks in advance,
When you install your SAP and DB, the sapinst will automatically do all the required .sh file settings. Why you want to chnage them? or soemthing went wrong with your variables?
You should be able to set the env in .dbenv.sh or .dbenv.csh (make sure you take a backup before try to chnage)
I have not changed anything in the db files. But when i switched from the csh shell to the sh shell the ORACLE_HOME variable was no longer set when I logged in. The steps i provided before is part of my troubleshooting process.
My guess is that for some reason in the sh shell that the environment variables are not staying set after the script has finished for some reason.
At Sunil Bujade
I am getting the environment variables in csh and not sh
I have manually looked at the .dbenv.sh and dbenv.csh
I created the following script with .dbenv lines
ORACLE_HOME=/oralce/<SID>/102_64; export ORACLE_HOME
This script tells me that ORACLE_HOME is correct when I run the script
After the script is done I use the command echo $ORACLE_HOME and it returns nothing
At Markus Doehr
I am using SuSE 10 64 bit
I am using the proper users ora<sid> and <sid>adm
Thanks for all your help,
to clarify my question a little more,
If i use the su command to change from root to ora<sid> in a root log in window the environment variables are not set
and if i just log in as ora<sid> then i do have the environment variables
this happens in the sh shell
in the csh shell i always have my environment vairables
> so just out of curiosity why does it have to be "su - orasid" to get the environment variables instead of "su orasid"
Change the effective user id and group id to that of USER. -, -l, --login make the shell a login shell
su is used to become another user during a login session. Invoked without a username, su defaults to becoming the super user. The optional argument - may be used to provide an environment similar to what the user would expect had the user logged in directly.