SQL vs Crontab

I've been trying to execute a script which call some SQL Queries for midnight report, using crontab I got the next mesage:

Message file sp1<lang>.msb not found
Error 6 initializing SQLPlus
Message file sp1<lang>.msb not found
Error 6 initializing SQL
Plus

If I use the "at" command it works perfectly but if I use crontab doesnt do anything.

The sp1us.msb file is located into
$ORACLE_HOME/sqlplus/mesg/

I've already added this path into the oracle user environment but simply it didnt work

Any idea?:mad:

What does your script look like, most importantly the part that calls SQLPlus?

this is as easy as it seems:
$ more Report.sh
sqlplus user/passwd @script1.sql
sqlplus user/passwd @script2.sql

at the begining I remembered that cron does not know the binaries path so I changed the script to this one:

/oracle/ora8/bin/sqlplus user/passwd @script1.sql
.
.
and so on.
It didnt work as well.

Later on I wrote tha absolute path of the queries:
/oracle/ora8/bin/sqlplus us/pass @/home/script1.sq
.
.

and so on, every change I did every test I performed with the "at" command and it worked out pretty fine, but if I use crontab it doesnt.

and the message was related to the sp1<lang>.msb file Im using US as lenguaje, so the file to be search must be ps1us.msb it is located at
$ORACLE_HOME/sqlplus/mesg
(oracle/ora8/sqlplus/mesg)

I hope it helps.

Hi
Have you tried su in crontab:

su user -c "/oracle/ora8/bin/sqlplus us/pass @/home/script1.sq"

j

i think the problem is that the crontab evironment of a user is not the same evironment when the same user is logged in.

When you set the correct PATH in the script with you fire by the crontab it will work.