When running a script from cron we first execute a script that sets all the
environment variables.  Here's the code we use:


#SET DATABASE ENVIRONMENT VARIABLES FOR DATABASE nyccp.  DSM 2/6/96
#
PATH=/oracle/oper:/oracle/product/8.0.4/lib:.:/opt/SUNWspro/bin:/usr/bin/sbi
n:/e
tc:/usr/bin:/usr/openwin/bin:/usr/ccs/bin:/usr/local/bin:/comm/BrxPU21:/orac
le/p
roduct/8.0.4/bin:/usr/ucb:/usr/bin/nsr:/usr/bin:/usr/sbin:.:$PATH;export
PATH
OLDHOME=$ORACLE_HOME
ORACLE_BASE=/oracle; export ORACLE_BASE
ORACLE_SID=nyccp; export ORACLE_SID
ORACLE_HOME=/oracle/product/8.0.4; export ORACLE_HOME
ORA_NLS=$ORACLE_HOME/ocommon/nls/admin/data; export ORA_NLS
ORACLE_DOC=$ORACLE_HOME/doc; export ORACLE_DOC
ORACLE_TERM=xsun5; export ORACLE_TERM
ORACLE_LIB=$ORACLE_HOME/lib; export ORACLE_LIB

CLASSPATH=$ORACLE_HOME/jdbc/lib/classes111.zip:.:$ORACLE_HOME/jdbc/lib;
export C
LASSPATH

TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
OPENWINHOME=/usr/openwin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/openwin/lib:/usr/dt/lib:$ORACLE_HOME/j
dbc/
lib
export LD_LIBRARY_PATH
#
TMPDIR=/tmp; export TMPDIR
WORKDIR=/tmp; export WORKDIR

# Put new ORACLE_HOME in path and remove old one
case "$OLDHOME" in
    "") OLDHOME=$PATH ;;        #This makes it so that null OLDHOME can't
match
esac                            #anything in next case statement

case "$PATH" in
    *$OLDHOME/bin*)     PATH=`echo $PATH | \
                            sed "s;$OLDHOME;$ORACLE_HOME;g"` ;;
    *$ORACLE_HOME/bin*) ;;
    *:)                 PATH=${PATH}$ORACLE_HOME/bin: ;;
    "")                 PATH=$ORACLE_HOME/bin ;;
    *)                  PATH=$PATH:$ORACLE_HOME/bin ;;
esac
PATH=/oracle/oper:$ORACLE_HOME/lib:/comm/local/jdk1.1.4/bin:$PATH
export PATH


-----Original Message-----
Sent: Saturday, April 14, 2001 2:00 AM
To: Multiple recipients of list ORACLE-L


Hi All,
        
        I am facing some problem while running sqlplus
scripts from crontab. Env is Tru64 Unix 4.0f and 
Oracle 7.2.3. 
        Through crontab all system commands run fine,
but when I try to invoke sqlplus, it gives following
error:

/oracle/test1.sh: -o: bad option(s)

        Also I have executed .profile of Oracle user 
in the beginning of command. The commands written 
in /oracle/test1.sh is as follows,

. /oracle/product/723/.profile
sqlplus -s system/manager @/oracle/test2.sql


        Any help/suggestion would be greatly appreciated.

TIA,
Rajesh
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rajesh Dayal
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Miller, Jay
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to