sqlloader not running

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

sqlloader not running

Roshan
This post was updated on .
Oracle Database 12c
Red Hat Linux 6

Hi,

I am running a sqlloader script from crontab. In the log file, I am getting
/home/jesh/MOB_DATA_jesh.sh: line 1: sqlldr: command not found

My bash profile is as follows

export ORACLE_HOME=/archicom/products/oracle/12.1.0/dbhome_1
export ORACLE_SID=ARCHICOM
export PATH=$PATH:$ORACLE_HOME/bin
#PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PS1='archicom>'
export PATH

Regards,
Roshan
Reply | Threaded
Open this post in threaded view
|

Re: sqlloader not running

ErmanArslansOracleBlog
Administrator
The shell environment of your script can not see the sqlldr.
It is related with the PATH env variable of your script's shell environment.

sqlldr is located in $ORACLE_HOME/bin

The environment must be set in the .bash_profile of the OS user that is executing the script or inside the script itself..
Reply | Threaded
Open this post in threaded view
|

Re: sqlloader not running

Roshan
Thanks :)
It is working now. I set the environment variables in script
Reply | Threaded
Open this post in threaded view
|

Re: sqlloader not running

ErmanArslansOracleBlog
Administrator
In reply to this post by ErmanArslansOracleBlog
Aha..
You are asking it for crontab.

Well, you can still set your env inside the script, but if you want to have that env inside the cron, you can set env variable in your crontab file.

Example:

crontab -e

ORACLE_HOME2=/erm
3 * * * * echo $ORACLE_HOME2 >/tmp/erm   --just for testing the ORACLE_HOME2 is set inside the cron.