I have created a script to gather stats on my oracle 12c database and given execute permission. Once i executed the scripts it works fine. But if i execute it through a cronjob it s not working as expected. Only the date of log file is updated and nothing in it as normal execution of the script. what would be the reason to fail the cron job
script and cron job as follows
sqlplus / as sysdba <<EOF
exec dbms_stats.gather_schema_stats('SIEBEL');
exit;
EOF
cronjob
19 12 * * * /export/home/oracle/amalw/stat_gather.sh > /export/home/oracle/amalw/stat_gather.log
db.env profile is at /export/home/oracle location