Calling SQLLDR using crontab [message #233143] |
Wed, 25 April 2007 00:29 |
rmkandan
Messages: 6 Registered: April 2007
|
Junior Member |
|
|
HI
I am able to execute the SQLLDR command in a shell script successfully.
But, when I call the same script using a Crontab, the job is failing at calling the SQLLDR
SQL*Loader execution encountered a fatal error
Please let me know if I am missing anything in calling the script
The cronjob entry is like below
20 13 * * * /export/home/cm_user/sqlldrscripts/run_exclusion.sh >> /export/home/cm_user/sqlldrscripts/nohup.log & >/dev/null 2>&1
Below is portion of my script :
# do not edit section below
CTRLFILE=user_info.ctl
LOGFILE=import_exclusion.log
DISCARDFILE=import_discard.log
BADFILE=import_badfile.log
CONNECTSTR=local
LOADFILE=import.csv
TODAY=`date +%d%m%y_%H%M%S`
#START=$(date +%s)
$ORACLE_HOME/bin/sqlldr userid = $USERID control = $SCRIPT_HOME/$CTRLFILE data = $LOADFILE log = $LOGFILE discard = $DISCARDFILE bad = $BADFILE errors=0 rows
=1000 direct=true
retval=$?
if [ $retval -ne 0 ]
then
echo "Errors during SQL LOAD"
case "$retval" in
1) echo "SQL*Loader execution exited with EX_FAIL, see logfile" ;;
2) echo "SQL*Loader execution exited with EX_WARN, see logfile" ;;
3) echo "SQL*Loader execution encountered a fatal error" ;;
*) echo "unknown return code";;
esac
else
echo "SQL*Loader execution successful"
#STARTSQL=$(date +%s)
STARTSQL=`date +%d%m%y:%H%M%S`
[Updated on: Wed, 25 April 2007 00:54] Report message to a moderator
|
|
|
|
|