bash_profile or .profile

Hi,
happy new year.
on AIX 6.1 , for user oracle , there are two files :
bash_profile and .profile

I do not know which one is executed when login ? How to know ,
More over in both of them we have :
in .profile :

ORACLE_HOME=/appli/oracle/product/10.2.0/db_1
ORACLE_PATH=/appli/oracle/product/10.2.0/db_1/bin
PATH=$PATH:$ORACLE_PATH
set -o vi
/usr/local/bin/bash
./appli/oracle/.bash_profile
export ORACLE_HOME ORACLE_PATH PATH ORATEMP ORATMP TMP TEMP

in bash_profile :

export ORACLE_HOME=/appli/oracle/product/10.2.0/db_1

But the ORACLE_HOME is not set :

:/appli/oracle#sqlplus / as sysdba
Error 6 initializing SQL*Plus
Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

Any idea, any help ?
Thank you.

What shell is this user assigned to?

thanks.
How to see that ?

e#env | grep SHELL
SHELL=/usr/bin/ksh

How to see that?

grep ^${USER}: /etc/passwd

I noticed the prompt is ending in "#", are you running these commands as root?

From man ksh (linux) first /etc/profile then $HOME/.profile are processed. Which means that ORACLE_HOME should be set in the environment. You can confirm this by:

env | grep ORACL

If set, then make sure that ORACLE_HOME is set correctly, and that it has the appropriate permissions:

cd $ORACLE_HOME
ls

BTW, please be aware that ksh and bash have different syntaxes, and source .bash_profile from .profile may cause problems.

are you running these commands as root? No. As oracle.

#more /etc/passwd | grep oracle
oracle:!:203:203::/appli/oracle:/usr/bin/ksh

Then it uses ksh.

appli/oracle#env | grep ORACL
/appli/oracle#

Then it is not set. What I said before. Even if in .profile and bash_profile we set it. Please see above.

I just noticed:

A sub-shell is being being started (in red) prior to the ORACLE_HOME, ORACLE_PATH, and other variables being exported into the environment.

If you need oracle to be running bash, either run man chsh (linux) or ask your friendly :slight_smile: unix admin to change it for you. But be careful, there may be dependencies on ksh being the default shell.