In Linux, the SQL plus upper and lower keys cannot display historical commands.

Source: Internet
Author: User

After running SQL statements in Linux sqlplus, you can use the up and down keys to find out the historical commands.

Follow the steps below to set

1. Download rlwrap from http://download.csdn.net/user/kkdelta

2. Install rlwrap

[root@localhost]# tar -zxvf rlwrap-0.30.tar.gz[root@localhost]# cd rlwrap-0.30[root@localhost rlwrap-0.30]# ./configure[root@localhost rlwrap-0.30]# make[root@localhost rlwrap-0.30]# make install[root@localhost rlwrap-0.30]# rlwrap

If you have the GNU Readline Library (ftp://ftp.gnu.org/gnu/readline/) to build this program! Error. You must install Yum-y install Readline *

3. Use rlwrap, rlwrap sqlplus/As sysdba

At this time, the familiar up/down key function is back.

4. Set the alias so that sqlplus runs in rlwrap by default.

[Root @ localhost
Rlwrap-0.30] # vi/home/Oracle/. bash_proFile
Add the following content
Alias sqlplus = 'maid sqlplus'
The alias definition uses single quotes instead of the one on the tab./home/Oracle/is the Oracle user's home directory.

The preceding settings require oracle users to log on again,

If the above settings do not work, you can set them in/home/Oracle/. bashrc so that alias will be set every time you change to bash.

Type
Sqlplus verification. If the following information is displayed, it indicates that the alias settings are successful.

Sqlplus
Is aliased to 'rlwrap sqlplus'


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.