Re: SQL Plus from a 'cron'
Date: 1995/08/07
Message-ID: <Michael_Kelly.59.000A0A18_at_dge.ceo.dg.com>#1/1
In article <1995Jul31.231116.23946_at_xsoft.uucp> ryan_at_xsoft.xerox.com (Michael
Ryan) writes:
>From: ryan_at_xsoft.xerox.com (Michael Ryan)>Subject: Re: SQL Plus
from a 'cron'>Summary: set ORACLE_HOME in your cron wrapper
>Keywords: ORACLE_HOME, script
>Date: Mon, 31 Jul 1995 23:11:16 GMT
>In article <3v1o1v$qh3_at_crcnis3.unl.edu>, nolan_at_helios.unl.edu (Michael Nolan) writes:
>>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.)
>what nobody's told you is that you need to set ORACLE_HOME in the
>environment so sqlplus can find its message files.
>#!/bin/sh
># my sqlplus cron script
>set ORACLE_HOME=/home/foo/bar/oracle/product/7.2 ; export ORACLE_HOME
>set PATH=${ORACLE_HOME}/bin:...; export PATH
>sqlplus user/password _at_/fully/qualified/name/for/script
From a security point of view it is MUCH better if you replace the line above with
sqlplus _at_/fully/qualified/name/for/script
and in the FIRST line of the script (before any comments etc.) put a line containing just the username/password pair. This way if someone does a ps -ef while the cron job is running all they will see is a process line similar to 'sqlplus _at_scriptname' and the security of your username/password is preserved.
Rgards,
Michael.
>good luck
>//michael
>--
>:: michael ryan , ryan_at_xsoft.xerox.com
>:: ob disclaimer: opinions expressed are not those of xerox, corp.
+-----------------------------------------------------------------------+ |Michael Kelly | Internet: Michael_Kelly_at_dge.ceo.dg.com | |Information Mgmt. Group | Telephone: +44 181-758-6000 | |Data General Ltd. |-------------------------------------------| |Great West Road | Data General employs people to speak on | |Brentford TW8 9AN | its behalf. I'm not one of them. | |England | I speak for myself. It's cheaper that way!| +-----------------------------------------------------------------------+Received on Mon Aug 07 1995 - 00:00:00 CEST