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: Error when running sqplus script in a crontab

Re: Error when running sqplus script in a crontab

From: Doug O'Leary <dkoleary_at_mediaone.net>
Date: Fri, 28 Jan 2000 07:57:40 -0600
Message-ID: <MPG.12fb5c51363bed7a989724@nntp.ce.mediaone.net>


[This followup was posted to comp.databases.oracle.misc and a copy was sent to the cited author.]

When running a script under cron, your environment isn't automatically sourced; therefore, none of the environment variables that oracle needs to run are set (ORACLE_SID, ORACLE_PATH, ORACLE_HOME, etc, etc). The easiest way to do this is to create a wrapper script around your sqlplus script and run the wrapper from cron. The wrapper would look something like:

#/bin/ksh
# wrapper script

. /home/dkoleary/.profile
sqlplus dkoleary/mypwd @/home/dkoleary/oracle/scripts/myscript

# end wrapper

--



Douglas K. O'Leary
Senior System Admin
dkoleary_at_mediaone.net
Received on Fri Jan 28 2000 - 07:57:40 CST

Original text of this message

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