This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cron, Oracle, and sqlplus


On Jan 9, James Schnedar wrote....

>I am experiencing a problem with running Oracle sqlplus within a shell
>script using cron.  The shell script runs correctly from the command
>line, but once I add it to cron, the shell script will execute up until
>the sqlplus command.  Therefore, cron is working correctly as well, but
>the addition of the sqlplus command causes it to hang.  The sqlplus
>session has started, but appears hung.
>

sqlplus needs some environment variables to be set, like ORACLE_HOME ( I
am not sure what others).  Andd cron does not set these variables while
starting your process.  Hence sqlplus hangs.

Solution: Use the line #!/bin/bash  as the first line of your shell script
and define the required environment variables in your .bashrc file.  Ig
you are using the Korn shell, ensure that these variables are set in
your .profile and use #!/bin/ksh as the first line of your shell script.
It will ensure that the correct shell interpreter is invoked and the
environment variables read appropriately.

-- 
Chiranth M.C.
Netkraft Pvt Ltd


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]