Re: SQL Plus from a 'cron'

From: Michael Nolan <nolan_at_helios.unl.edu>
Date: 1995/07/25
Message-ID: <3v1o1v$qh3_at_crcnis3.unl.edu>#1/1


bps9_at_bps9.ebay.sun.com (Ravi Sankar) writes:

>Is it possible to execute SQL Script from a cron function.

Yes, we do it all the time. The problem is that cron does NOT execute the .profile, so you don't have the environmental variables that Oracle needs defined. (If you use csh will need to translate your .cshrc and/or .login commands to Bourne shell scripts, because cron uses /bin/sh.)

You can try something like the following in your cron file:

00 00 * * * . .profile;sqlplus user/password _at_sqlfile

(We actually use a separate file called .oracle which contains all the necessary variables for Oracle, and then execute it from within .profile.)

---
Michael Nolan, Sysop for the DBMS RoundTable on GEnie
nolan_at_tssi.com, dbms_at_genie.com, nolan_at_inetnebr.com
(posted from nolan_at_helios.unl.edu)
Received on Tue Jul 25 1995 - 00:00:00 CEST

Original text of this message