This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: cron, Oracle, and sqlplus
- From: Chiranth <Chiranth dot m at net-kraft dot com>
- To: James Schnedar <jims at nmmcc dot com>
- Cc: cygwin at cygwin dot com
- Date: Thu, 16 Jan 2003 20:05:53 +0530
- Subject: 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/