Using Uniread to solve the Sql*plus command line history callback function under Linux

Source: Internet
Author: User
Tags command line readline sqlplus linux
Resolve | command line


uses Uniread to solve the Sql*plus command line history callback function under Linux





Author: fenng








you know that the Sql*plus in the Windows platform command line has the function of a command-line history callback, under the Sql*plus tool, you can take advantage of the keyboard's


the UP ARROW key to callback the command line. And on Linux there is no such function (although the Shell can do this, but sql*plus not).


This feature is almost indispensable for CLI enthusiasts, and I don't know why Oracle doesn't add this functionality. It's not known.





Some sql*plus alternative products (such as Gqlplus and Yasql) have command-line editing and command history capabilities, but this


Some products have been slow to develop--some have even stopped updating.





(See also: Gqlplus http://sourceforge.net/projects/gqlplus and Yasql http://sourceforge.net/projects/yasql/


, etc. sql*plus alternative tools).





on the Internet, found a solution under Linux, and now share.





This tool is called Uniread (http://sourceforge.net/projects/uniread/), familiar with Linux turned friends may see the name has been


thought of something: ReadLine. Yes, the tool uses the GNU ReadLine Library to fulfill our needs.





Let's take a look at the introduction to the tool:





Uniread-universal Readline-adds full readline Support (command editing, history, etc.) to any existing


Interactive command-line program. Common examples are Oracle ' s sqlplus or Jython. Uniread would work


on any POSIX platform with Perl.





can see that the tool can provide complete readline support for any existing interactive command-line programs.





Download the source program from this site. The current stable version is 1.01.





the system must have Perl installed before installing the tool, and you must also have three kits:





GNU ReadLine


http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html





Term::readline::gnu


http://search.cpan.org/dist/Term-ReadLine-Gnu/





Io::tty


http://search.cpan.org/dist/IO-Tty/





where the GNU ReadLine page above is not open on my machine (inaccessible?), if you are in the same situation, you can go to


http://www.gnu.org/directory/readline.html this page to download.





after downloading, first decompression:





# TAR-XZVF readline-4.3.tar.gz





Enter into the directory to compile and install:





#./configure


# Make


# make install




Installation of the rear two
: Tar-zxvf ...


into the directory:





# perl makefile.pl


# Make


# make install




After the
are installed, perform the Uniread installation:





#tar-XZVF uniread-1.01.tar.gz


#cd uniread-1.01


#./configure


#make


#make Install





Note: The above command line operation is located in the absolute path for convenience and omitted, your environment will certainly be different from mine, in addition, it is recommended to use normal user compile, and then use root for


make install.




After the
are all installed


Switch to Oracle User:





$ uniread Sqlplus/nolog





output is similar to the following:





[Uniread] Loaded history (lines)//mine has run once, Uniread buffers 12 lines history





sql*plus:release 10.1.0.2.0-production on Sat Mar 6 00:23:05 2004





Copyright (c) 1982, Oracle. All rights reserved.





sql>








View the Manual of Uniread:





$man Uniread








you can make a sqlplus alias, uniread use is transparent, is not very convenient? Don't forget: This tool is versatile, not just sql*plus


can be used in this way, and so can other similar command-line programs.








Reference content:





uniread site Http://sourceforge.net/projects/uniread





GNU readline http://www.gnu.org/directory/readline.html


"The Readline Library provides a set of functions for use by applications this allow users to edit


command lines as they are typed in. "





is still a panacea for Google http://www.google.com

















Original Source:


<a href= "http://www.dbanotes.net/Oracle/uniread-howto.htm" >http://www.dbanotes.net/oracle/ Uniread-howto.htm</a>








Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.