Home » Infrastructure » Unix » Cron Job Problem (Urgent)
Cron Job Problem (Urgent) [message #97930] Wed, 25 June 2003 06:31 Go to next message
kothari Alpesh
Messages: 27
Registered: December 2001
Junior Member
Dear All,
I have written one Shell Script called allGJNos.sh like

/export/home/oracle/product/8.1.7/bin/sqlplus idea/idea <<SQLSESSION

set numwidth 15;
set pagesize 200;
spool /export/home/oracle/Idea_GJ_India_1.txt;
select mobile_no from wc_alert_reg_mstr where s_date=trunc(SYSDATE-1) and pkg_id=1;
spool off;
spool /export/home/oracle/Idea_GJ_India_2.txt;
select mobile_no from wc_alert_reg_mstr where s_date=trunc(SYSDATE-1) and pkg_id=2;
spool off;
spool /export/home/oracle/Idea_GJ_India_3.txt;
select mobile_no from wc_alert_reg_mstr where s_date=trunc(SYSDATE-1) and pkg_id=3;
spool off;
exit
SQLSESSION

ftp -n 203.88.141.195 <<FTPSESSION
user idea ideaPower
bin
cd approval_nos
put Idea_GJ_India_1.txt
put Idea_GJ_India_2.txt
put Idea_GJ_India_3.txt
bye
FTPSESSION

which, Runs perfectly from the $ prompt But when i Set it in the Cron job its gives following errors
Cron is as under
5,10,15,20,25,30,35,40,45,50,55,0 * * * * /export/home/oracle/allGJNos.sh 1>/export/home/oracle/allgj.log 2>&1

Message file sp1<lang>.msb not found
Error 6 initializing SQL*Plus
Re: Cron Job Problem (Urgent) [message #97931 is a reply to message #97930] Wed, 25 June 2003 07:12 Go to previous messageGo to next message
Ben Li
Messages: 3
Registered: May 2002
Junior Member
Alpesh,

Please add this line to the beginning:
. ~oracle/.profile

Inside this file you should have the Oracle environmental variables (ORACLE_HOME, PATH, etc.) set up.

Ben
Re: Cron Job Problem (Urgent) [message #97938 is a reply to message #97930] Mon, 30 June 2003 06:12 Go to previous message
Amit
Messages: 166
Registered: February 1999
Senior Member
add following at the begining of your script
it will definitely work

ORACLE_SID=???
export ORACLE_SID
ORACLE_HOME=???
export ORACLE_HOME

if not contact me any time
amit
Previous Topic: difference betwee cpio and tar commands
Next Topic: Difference between *.Z & *.z in Unix file format
Goto Forum:
  


Current Time: Sun Sep 27 22:27:04 CDT 2020