Rlwrap enables up and down arrows on the keyboard to call up SQL commands executed in history

Source: Internet
Author: User

On the Linux platform, you can use the up and down arrows on the keyboard to call up the SQL commands executed in history at the SQL * PLUS command line prompt of the Oracle database, you can consider using the rlwrap open-source tool.
 
Now, record the installation process (in the Red Hat Enterprise Linux as 5.4 environment ).

① First download rlwrap:
Download the composite OS version at: http://rpm.pbone.net/index.php3

② Install related packages

Libtermcap-devel-2.0.8-46.1.i386.rpm
Readline-devel-5.1-1.1.i386.rpm

[Root @ server1 ~] # Rpm-ivh libtermcap-devel-2.0.8-46.1.i386.rpm
Warning: libtermcap-devel-2.0.8-46.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ######################################## ### [100%]
1: libtermcap-devel ##################################### ###### [100%]

[Root @ server1 ~] # Rpm-ivh readline-devel-5.1-1.1.i386.rpm
Warning: readline-devel-5.1-1.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ######################################## ### [100%]
1: readline-devel ##################################### ###### [100%]

③ Install the rlwrap package
Root@www.bkjia.com ~ # Rpm-ivh rlwrap-0.37-1.el5.i386.rpm
Warning: rlwrap-0.37-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
Preparing... ######################################## ### [100%]
1: rlwrap ####################################### #### [100%]
Root@www.bkjia.com ~ #

④ Modify the configuration file of an oracle user
Root@www.bkjia.com ~ # Su-oracle
Oracle@www.bkjia.com ~ $ Vi. bash_profile

Alias sqlplus = 'maid sqlplus/nolog' -- (it is best to add this information and! Wq save and quit)
Oracle@www.bkjia.com ~ $ Source. bash_profile

⑤ This is done. You only need to use the root user to execute sqlplus to enter the SQL * PLUS command line prompt, and you can use the upper and lower keys of the keyboard to call up the previously executed historical commands.

For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12

Related Article

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.