I have a ksh script which will connect to a database and executes some sql scripts. If i run the ksh script it is working fine. But if i schedule it to run at a perticular time using cron the sql script is not running. The scriptl initially creates a spool file for sql script and then connects and executes the sql script. I can see the spool file created but nothing inside it.
Any idea what could be wrong when the script is run using cron?
is there any simple way to create a log file for this script ?
Yes. $ORACLE_HOME and $ORACLE_SID are set correctly. and the script uses full path name when calling other scripts. I can see the successful execution when I run the script directly from shell.
I set the required environment varibales like ORACLE_HOME and ORACLE_SID. Still not able to get in... i can see a new error now after setting the env var !
Error 6 initializing SQL*Plus
Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
Don't forget to export the environment variables. We are setting them for the benefit of the processes we call (e.g. "sqlplus").
Also it is much better to find "sqlplus" through unix PATH. The same environment then works for all Oracle unix programs.