I am not sure if this is a bash / shell question or oracle question. I am on linux and oracle 11g.
I have always export my ORACLE_HOME and ORACLE_SID variable and e.g. using invoking sqlplus is no issue.
I thought have thought that sqlplus is able to be invoked because it is in my PATH variable with $ORACLE_HOME/bin added to $PATH.
=============================================
Today, not sure why, i decided to unset ORACLE_HOME and ORACLE_SID and just declare them as local variable to my current shell. My PATH is still the same. (contain the full path to oracle_home/bin)
ORACLE_HOME=/path/to/oracle_home ORACLE_SID=orcl
and I invoke sqlplus from the shell.
==============================================
The sqlplus program is able to be located, but it is not able to run saying that i need to set my ORACLE_HOME
[oracle@SJOAM ~]$ sqlplus
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
[oracle@SJOAM ~]$
===============================================
My question is
1) why is sqlplus unable to know the ORACLE_HOME and ORACLE_SID since it is run from the current shell ?
is it because it is invoked as a child process and thus cannot access the parent process (bash) local variable ?
Regards, Noob