Dear experts,
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,
James Anderson
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.
Are you getting the env variable in sh and not in csh?
Check the .dbenv.sh and dbenv.csh and check whether the ORACLE_HOME variable is set in these files.
> What has to be changed so that the environment variables stay after a script in sh runs?
What operating system are you using?
And: I never had to set anything manually when working with the proper users, you use different users?
Markus
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
echo $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,
James Anderson
> I am using SuSE 10 64 bit
> I am using the proper users ora<sid> and <sid>adm
Just to get the problem: those two users don't have ORACLE_HOME set when you change the shell to anything else than /bin/sh or /bin/csh?
Markus
in sh there is no ORACLE_HOME
in csh ORACLE_HOME is set correctly
Do you have a .profile in the home directory?
Markus
I do have a .profile in my <sid>adm user account
Checking for a common misunderstandig:
I have tried to mannualy run the .dbenv_<hostname>.sh, which did not solve the problem.
How have you tried?
Don't do this:
.dbenv_<hostname>.sh
but this:
. .dbenv_<hostname>.sh
well i originally made that mistake but then i figured out that it is a file that has a dot at the beginning.
I have to believe that the problem originates with the fact that i have switched shells.
Thanks for all you 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
Once again checking for a common misunderstanding:
If i use the su command ...
How?
It's not su orasid, but su - orasid.
so just out of curiosity why does it have to be "su - orasid" to get the environment variables instead of "su orasid"
> so just out of curiosity why does it have to be "su - orasid" to get the environment variables instead of "su orasid"
man su
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.
Markus