How to use SQL * plus in Linux to display up/down key history (install rlwrap and readline)

Source: Internet
Author: User
In Windows, SQL * plus makes it easier to display the history of built-in up and down keys, but this function is not available in linux by default. You need to expand it to use it.

In Windows, SQL * plus makes it easier to display the history of built-in up and down keys, but this function is not available in linux by default. You need to expand it to use it.

In Windows, SQL * plus makes it easy to display the built-in upper and lower key history, but linux does not have this function by default. You need to expand it to use it, here we introduce two software packages to be installed, rlwrap and readline. After installation, SQL * plus in Linux can display the up and down key history. Many of my friends on the Internet have such questions. Here, we will record the installation process. The following two packages are available. Including: rlwrap-0.37.tar.gz( to readline-6.2.tar.gz.

Readline-6.2.tar.gz Software Package download:

Free on

Both the user name and password are

The specific download directory is in the/June/July 21/Linux/how to display the up/down key history using SQL & plus (install rlwrap and readline)

For the download method, see

------------------------------------ Split line ------------------------------------

The installation process is simple. First, readline and then rlwrap

Root User:

Tar-xzvf readline-6.2.tar.gz

Cd readline-6.2

./Configure

Make

Make install

The rlwrap process is the same

Tar-xzvf rlwrap-0.37.tar.gz

Cd rlwrap-0.37

./Configure

Make

Make install

After the installation is successful, the following result will be displayed in rlwrap under the root user.

[Root @ rh56 ~] # Rlwrap
Usage: rlwrap [options] command...

Options:
-A [password:] -- always-readline [= password:]
-A -- ansi-color-aware
-B -- Break-chars =
-C -- complete-filenames
-C -- Command-name =
-D <0 | 1 | 2> -- history-no-dupes = <0 | 1 | 2>
-F -- File =
-G -- Forget-matching =
-H -- help
-H -- History-filename =
-I -- case-insensitive
-I -- pass-sigint-as-sigterm
-L -- Logfile =
-N -- no-warnings
-N -- no-children
-O -- one-shot
-O -- Only-cook =
-P [color] -- prompt-color [= color]
-P -- Pre-given =
-Q -- Quote-characters =
-M [newline substitute] -- multi-line [= newline substitute]
-R -- remember
-R -- renice
-V -- version
-S -- Histsize = (Negative: readonly)
-S -- Substitute-prompt =
-T -- Set-term-name =
-W -- Wait-before-prompt = (Msec, <0: patient mode)
-Z -- Filter =

Bug reports, suggestions, updates:
~ Hlub/uck/rlwrap/

Switch to the Oracle user and modify the environment variables.

In fact, not only SQL * plus can benefit, but also other tools that need to execute command lines.

Alias s = 'rlwrap sqlplus/as sysdba'
Alias adrci = 'rlwrap adrci'
Alias ggsci = 'lwrap/u01/gg/ggsci'
Alias bbed = 'maid $ ORACLE_HOME/rdbms/lib/bbed parfile =/home/oracle/bbed/dex. par'
Alias rman = 'rlwrap rman target /'

This is the end. Try it on your own.

Related reading:

Rlwrap

SQLPLUS spool to dynamic Log File Name

Oracle SQLPLUS prompt settings

Accelerate SQL return by setting SQLPLUS ARRAYSIZE (row prefetch)

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.