crontab job loosing the Oracle env settings

"Yoav Givon" <[email protected]>
Newsgroups gmane.linux.suse.oracle.general
Message-ID <0135B8EB30B55447A4DF0948B228655DA8F70B@hh-exchange-01.fcruise.com>
Hi All 

 

I am trying  to create a shell script   that will restart  the Listener
process   in case the  listener was shutdown unexpectedly . 

 

My   shell script will be run successfully once invoked from  prompt
(logged  as  oracle)   BUT  once as a crontab job I am loosing ALL
oracle related environment  settings (my guess ) . 

if  my shell script  would  Just   if..  then ...   lsnrctl start   then
in my ORACLE  mail message  it will say "program can not  found .. )
but   if I will add   the  full path to my script ,
/opt/oracle/prosuct/10.1.0/db_1/bin/lsnrctl start 

 

Then I will get different  error message in my mail 

 

 

LSNRCTL for  Linux .... 

 

Message 1070 not  found ..  No message  file  for  product ... 
TNS-12560 
TNS-00515  message 515 not  found 

 

 

In other  words , The  shell script does  not  know how  ot get  to
TNSNAMES.ORA

 

 

My theory as  of  the above  two examples   is  that   once  the  shell
script  is  invoked from within crontab  (although the  crontab job was
created while  logged  as  Oracle ) 

 

The  whole  oracle environment is  somehow lost . 

 

 

QUESTION - Do I have   to add something to the crontab job to facilitate
the oracle  environment ?  Have  I missed something  else  here ? 

 

 

Thank you  for  your  help 

 

Yoav
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.