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

Home -> Community -> Usenet -> c.d.o.server -> Re: cron scripting of sql*plus

Re: cron scripting of sql*plus

From: Spencer <spencerp_at_swbell.net>
Date: Tue, 23 Jan 2001 19:49:23 -0600
Message-ID: <0vqb6.122$6k1.81075@nnrp2.sbc.net>

when the script is run by cron, the environment is not setup like it is when you logon. (depending on your shell, when you logon, the .profile script in your home directory is run.)

you need to setup the Oracle environment. one way to do this is to include (in the script run by cron) a call to another script that sets ORACLE_SID, ORACLE_HOME, PATH,

$ cat mysqlplus.sh:

#! /bin/sh
# setup oracle environment
. crontab_env.sh
# my sqlplus script
...

$ cat crontab_env.sh

#! /bin/sh
ORACLE_SID=orcl
export ORACLE_SID
ORAENV_ASK=NO
export ORAENV_ASK
. oraenv

HTH "Matt Collins" <mcollins_at_bay.csuhayward.edu> wrote in message news:3A6E18F0.6377E618_at_bay.csuhayward.edu...
> I am wondering if anyone can help me troubleshoot a sqlplus script.
>
> I have some sqlplus commands in a script file that is run by a cron
> job. I am getting an error message from the cron run as follows:
>
> Message file sp1<lang>.msb not found
> Error 6 initializing SQL*Plus
> Message 2100 not found; No message file for product=RDBMS,
> facility=ULMessage 2100 not found; No message file for product=RDBMS,
> facility
> =ULMessage 2100 not found; No message file for product=RDBMS,
> facility=ULMessage 2100 not found; No message file for product=RDBMS,
> facil
> ity=ULMessage 2100 not found; No message file for product=RDBMS,
> facility=ULMessage 2100 not found; No message file for product=RDBMS, fa
> cility=ULMessage file sp1<lang>.msb not found
> Error 6 initializing SQL*Plus
>
> If I run the same script from the command line (as the same user) then
> it works fine. Any suggestions would be helpful.
>
> Thanks,
> -Matt-
>
Received on Tue Jan 23 2001 - 19:49:23 CST

Original text of this message

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