Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Thu, 16 Jan 2003 20:05:53 +0530 From: Chiranth X-X-Sender: Chiranth DOT m AT nkpl-252 To: James Schnedar cc: cygwin AT cygwin DOT com Subject: Re: cron, Oracle, and sqlplus In-Reply-To: <3E1E117E.F8C2E56E@nmmcc.com> Message-ID: X-System: Cygwin on W2K MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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/