bash_profile or .profile


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users bash_profile or .profile
# 1  
Old 01-04-2011
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 :
Code:
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 :

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

But the ORACLE_HOME is not set :
Code:
:/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.
# 2  
Old 01-04-2011
What shell is this user assigned to?
# 3  
Old 01-04-2011
thanks.
How to see that ?

e#env | grep SHELL
SHELL=/usr/bin/ksh
# 4  
Old 01-04-2011
How to see that?
Code:
grep ^${USER}: /etc/passwd

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

From ksh first /etc/profile then $HOME/.profile are processed. Which means that ORACLE_HOME should be set in the environment. You can confirm this by:
Code:
env | grep ORACL

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

BTW, please be aware that ksh and bash have different syntaxes, and source .bash_profile from .profile may cause problems.
# 5  
Old 01-04-2011
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.
# 6  
Old 01-04-2011
I just noticed:
Quote:
Originally Posted by big123456
<snip>
in .profile :
Code:
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

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 chsh or ask your friendly Smilie unix admin to change it for you. But be careful, there may be dependencies on ksh being the default shell.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Renaming .bash_profile to .profile

Hi Gurus, Recently we have migrated our servers from AIX to Linux. Most of the scripts written in AIX server are sourcing environment variables using .profile file. Now we have the following options: 1. Change all the scripts where ever .profile is being used and replace it with... (14 Replies)
Discussion started by: svajhala
14 Replies

2. UNIX for Dummies Questions & Answers

.bash_profile question

Hello everyone, I'm trying to set my .bash_profile to change my primary prompt from this: banbatchtest1v:MCPPRD:~>to this: banbatchtest1v:MCPPRD:/home/rcarvall> Here's what my .bash_profile looks like right now: # .bash_profile # Get the aliases and functions if ; then .... (2 Replies)
Discussion started by: galileo1
2 Replies

3. UNIX for Dummies Questions & Answers

Bash_profile versus bashrc

Hi All Please can you tell , what is the difference between bash_profile and bashrc. How to create them? (8 Replies)
Discussion started by: fretagi
8 Replies

4. UNIX for Dummies Questions & Answers

.bash_profile versus .profile of user in Solaris 10

Hi All I am kind of confused, when to use .bash_profile or .profile I have just created a user on a test server, with: useradd -u 103 -d /fretagi -m -s /bin/bash fretagi but now in its home dir I have: -bash-3.2$ ls -al total 14 drwxr-xr-x 2 fretagi other 512 Dec 5 15:54 .... (5 Replies)
Discussion started by: fretagi
5 Replies

5. Infrastructure Monitoring

trap in etc/profile and user .profile

Hello I really wonder what's trap in etc/profile and in each user .profile. I try to google for it but I think I have no luck. Mostly hit is SNMP traps which I think it is not the same thing. I want to know ... 1. What's a "trap 2 3" means and are there any other value I can set... (4 Replies)
Discussion started by: Smith
4 Replies

6. UNIX for Dummies Questions & Answers

bash_profile does not working

Hi all. when i connect as user megaguru i have a problem my .bash_profile does not working^:( if i do: . ./.bash_profile all enviroment variables are in place. How can i force linux to use .bash_profile before logon process? thanx in advance. (1 Reply)
Discussion started by: smallman
1 Replies

7. Shell Programming and Scripting

question in .bash_profile

We are more users using the oracle account, and people want to include theyr own files in .bash_profile. Like this: while ; do echo -n "LOGNAME is '$LOGNAME' (no sens), who are you? " >/dev/stderr read ln export LOGNAME=$ln done This works well when logging in to... (1 Reply)
Discussion started by: hannem
1 Replies

8. Shell Programming and Scripting

.bash_profile problem

Hi Guys, I modified my .bash_profile script , and tried to change the prompt. Following is the line of code in my .bash_profile script. export PS1=" \W " But I get the output as: \W This appears to be my prompt now. Any idea what should be done.. Thanks! (0 Replies)
Discussion started by: nua7
0 Replies

9. UNIX for Dummies Questions & Answers

numbers on permanently through .bash_profile

Hi Can anyone tell me if it is at all possible to edit ones .bash_profile, to make the setting on of line numbers (in vi/vim), permanent? I've been to a few IRC channels and people keep telling me it is more of a vi/vim thing and to use something called ".vimrc", however I heard that it is... (3 Replies)
Discussion started by: zorrokan
3 Replies

10. UNIX for Dummies Questions & Answers

changed .profile but didnt ./.profile, yet reflected changes

hi , i added ls -F to .profile. and i need to do ./.profile for the effect to take effect BUT i didnt and YET the next day when i came to work and log in, the changes took effect. i am on aix. please explain.. thanks (4 Replies)
Discussion started by: yls177
4 Replies
Login or Register to Ask a Question