(You need to be familiar with AutoSys, Perl, and Oraperl to appreciate what follows):
We have AutoSys at my company, with one Unix box hosting the Event Server, and I want use AutoSys to run jobs on another Unix machine (aka “the client”). The remote agent is properly installed on the client. The jobs are Perl scripts which connect to an Oracle database, and run PL/SQL scipts (or in some cases vanilla SQL). If I log onto the client and run the scripts from the command prompt, they work fine. But I can’t get them to run through the AutoSys operator console.
Is there anyone who’s worked with this who is willing to offer the benefit of their experience?
Thanks
I run into this problem all of the time. It is usually caused by one of two things.
-
You are using a partial path in one of your scripts that is no longer valid when autosys logs in under its user name and password. In my experience, you should always use the full path starting with the root directory whenever you refer to a file in a script run from autosys. Check all your scripts and make sure that all files are refered to by their full path.
-
Autosys can’t find SQL Plus. I had this happen two weeks ago. I fixed it by setting the following variable within the script:
export ORACLE_SID=PROD
export PATH=$PATH:.:/u01/oracle/product/7.3.4/bin:
This tells autosys where to look to find the SQL Plus program when it logs in under its user name and password.
Oh BTW. You need to set up an error log as part of the job from within autosys. Go to job definition and click on Advanced Features for the job. Put in a file name for a Redirect to Standard Error. Try to run the job from autosys and then look at the error file. It should tell you the parts that it is failing on. Like I said, it probably cannot find a file because of an incomplete path.
Thanks, Shag, for replying.
I suspected it might be a problem with the file paths, so I tried changing the AutoSys command line from this:
$DPS_perl/run_plsql_task LCL_To_DIF_Dlr_Ld_Prep $DPS_task
to one in which the paths represented by $DPS_perl and $DPS_task were spelled out in full, and it still wouldn’t run. In a way I’m glad that doesn’t seem to be the problem because if possible I’d like to set this up in a manner that can be ported to production with a minimum of fuss.
I even tried having AutoSys doing a “helloworld.pl”, using both my version of Perl and the standard version without success.
Thanks mainly to Shagnasty’s input, and also a coworker here who suggested the same thing. It was definitely a problem with the file paths. My co-worker suggested that I just hardcode the paths in my AutoSys jobs, but I was very reluctant to do that as it would complicate porting the implementation to production considerably. But I found I could get around the problem by having the Perl script read a standard repository of environment variables with their exports, and it worked.