Re: Cygwin for use on Oracle Servers

From: Kurt Franke <>
Date: Tue, 20 Oct 2009 13:56:42 +0200
Message-Id: <>

Hi Jared,

here are some hints I do remember quickly:

a limit in cygwin is that the fifos used are cygwin specific  and thus not known as fifos to sqlplus - thus it is not  possible to spool to a fifo like on unix platforms for further  processing with another programs  

SQLPATH is directly read from the registry by sqlplus from   HKEY_CURRENT_USER\Environment\SQLPATH
or, if there is no entry for it, from
  HKEY_LOACL_MACHINE\SOFTWARE\ORACLE\<<oraclehome-name>>\SQLPATH Because of this changing just the environment in a cygwin shell before calling sqlplus doesn't have any effect on the SQLPATH used in sqlplus. Thus it is not possible to use different SQLPATH values for different database-application-users to hold the application specific scripts separatly without changing the registry during each call which may also not be possible due to lacking permissions for Non-Administrator-Accounts.

the umask setting of a cygwin process isnot inherited through sqlplus to shell scripts started from within sqlplus. Personally I use always a script for sqlplus starting which in addition to a lot of another things sets the environment variable BASH_ENV to a special script does umask setting and may do some another initialization. The BASH_ENV environment variable is inherited through sqlplus to processes started from within it and then is used by bash shell at startup and is just sourced like .bashrc etc. Of course to get this effect each command must be called as argument to a bash call i. e.
$bash &my_shell_script
$bash -c 'echo hello >hello.out'

spooling files in a windows sqlplus will always have CRLF as end-of-line characters when spooling shell scripts dynamically this will cause trouble because of the CR character to handle this, after spooling just add a line like the following to the sql script (define variables needed:
define dot = '.'
define minus = '-'
define ampersand = '&'
define shnam = ''
$bash -c 'sed -e \'s/\r//\' &shnam >&shnam&dot&minus &ampersand&ampersand mv -f &shnam&dot&minus &shnam' Then after making it executable a call will won't break any longer with the CR problem $bash -c 'chmod u+x &shnam'
$bash '&shnam'



> -----Ursprüngliche Nachricht-----
> Von: "Jared Still" <>
> Gesendet: 19.10.09 20:01:18
> An: Oracle-L Freelists <>
> Betreff: Cygwin for use on Oracle Servers

It seems the windows servers are going to proliferate here. (sigh)
> There are a number of you that are regularly using Cygwin on windows
> servers so as to have a decent scripting and cmd line environment.
> While I have used Cygwin casually on my own laptop for use with
> Oracle, I have never made serious use of it.
> If you have any tips to offer (ie. hard learned lessons) for using
> Cygwin
> it would be appreciated. If I learn enough I can consolidate it into
> a blog entry.
> Some examples of what I am looking for:
> How do you set up the PATH? (linux style or DOS style directories in
> PATH?)
> Any tricks to setting up the Oracle ENV variables?
> etc...
> Thanks,
> Jared Still
> Certifiable Oracle DBA and Part Time Perl Evangelist
> Oracle Blog:
> Home Page:

Received on Tue Oct 20 2009 - 06:56:42 CDT

Original text of this message