Mar-16-2017, 10:06 AM
(Mar-15-2017, 09:37 PM)Ofnuts Wrote: I assume things in crontab are executed with a very specific user and environment, and the PATH can be different from what you have in a plain user session. So for a start I would give the full path to the executable, but this could not be sufficient.
As an experiment, write a Python script that reports the executing user id, the working directory and dumps the environment variables and have it execute from crontab.
Thanks for reply Ofnust,
I was able to solve it yesterday but due to deadlines could not post an update.
You are right , the issue was because of an environment variable needed by oracle utilities.
below is the code which solved it.
session = Popen([r'/u01/app/oracle/product/11.2.0/db1/bin/dgmgrl','username/password@dbname','stop observer', '-logfile', '/u01/app/oracle/broker/fsfo_mydg.log'],stdout=PIPE, stderr=PIPE, env=dict(os.environ, ORACLE_HOME="/u01/app/oracle/product/11.2.0/db1"))Regards,
Nitin