Friday, April 16, 2010

sqlplus command wrapper for cygwin rxvt (terminal)

 From limited scrollback lines of  ugly MS-DOS COMMAND prompt, I link to cywin bash shell, later on I found rxvt (ouR eXended Virtual Terminal), then I started thinking using local sqlplus without SSH logon to remote database server, finally I realize that I need command wrapper rlwrap, which the exactly same as what I use in Linux.


Without rlwrap , you can see the funny problem with UP, DOWN key as described in http://www.cygwin.com/ml/cygwin/2007-10/msg00465.html


To install rlwrap in Cygwin,  choose rlwrap under Utils packages of cygwin setup program. Now try :


$ sqlplus perfstat/XXXX@ICTD
/usr/bin/rlwrap.exe: error while loading shared libraries: cygreadline6.dll: cannot open shared object file: No such file or directory

oops !


search "cygreadline*.*"  under c:\cygwin,  found cygreadline7.dll under c:\cygwin\bin


Search "readline" again in cgywin setup program, found there are version5, 6,7 dll of cyglibreadline under Lib packages,  so I install  version 6.

This time,  it works !!!

 Search c:\cygwin folder again , see cygreadline6.dll,  cygreadline7.dll under c:\cygwin\bin

 
Finally, I define below in .bashrc
alias sqlplus='rlwrap sqlplus'




 It is exact what I have in Linux environment.  :)

Next step, I will configure using Public Key for SSH authentication on local PC , so as not to bother with password for tens of  logons everyday.

Reference: 

http://www.cygwin.com/ml/cygwin/2007-10/msg00465.html
http://infrablue.tripod.com/cygwin.html