Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Cron and UTL problem

Re: Cron and UTL problem

From: Tim X <timx_at_spamto.devnul.com>
Date: 01 May 2003 19:18:16 +1000
Message-ID: <87wuhbc9ev.fsf@tiger.rapttech.com.au>


>>>>> "David" == David <kokirulo1980_at_yahoo.es> writes:

 David> Hello, thanks and sorry for my english: I have a very huge  David> problem I try to explain correctly:

 David> I have a shell that calls a pl-sql program, after a pro-cobol
 David> program and after another pl-sql program. This shell works
 David> correctly and do every thing that I want. The problem is when
 David> I put into the cron, the first pl-sql programs works ok, the
 David> procobol too and the last pl-sql exists for the exception
 David> SYS.UTL_FILE.INVALID_OPERATION. This pl-sql opens one file for
 David> reading and four for writing, and when is trying to open the
 David> third file exists for the mentioned exception.

 David> I like to be clear about this shell works correctly when I
 David> execute in a normal unix sesion and its when I put in the cron  David> when fails.

There are two possibilities I can think of -

  1. When a script runs under cron, it does not run in a login shell. This means that any environment variables which are set in your shell login script will not be available when running scripts under cron. So, if you set your PATH, ORACLE_SID, ORACLE_HOME etc in a .login/.login.csh/.profile/.bash_profile etc, then none of these values are available when the cron runs.

A common error occurs with cron scripts because they don't have the required path setting or some other environment variable. Depending on your platform, you may be able to set environment variables within the crontab file or you can set them explicitly within your script.

2. Are you trying to run the cron job under the cron of the user you are running it as in the shell? If you are trying to run it as a different user than when you run it within a shell, it is possibly a permissions problem.

Tim

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!
Received on Thu May 01 2003 - 04:18:16 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US