I saw the rlwrap tool on the Forum. It feels good. I will make a summary. (Rlwrap download)
In Windows, when running SQL * Plus in the doscommand window, you can use the up and down keys to skip the previously executed SQL statements. you can modify them as needed and press Enter to submit them again. however, when running SQL * Plus in Linux Shell, it does not provide browsing history command lines. to achieve the same purpose in Linux, you can install rlwrap. This program is a Shell and can run any commands you provide to it, including parameters, and add the command history browsing function. the rlwrap program is under the GPL license.
1. Install readline
The OS installation CD provides the readline package.
[Root @ Oracle11g ~] # Rpm-Uvh readline *
Error: Failed dependencies: libtermcap-devel is needed by readline-devel-5.1-1.1.i386.rpm
[Root @ oracle11g ~] # Rpm-Uvh libtermcap-devel-2.0.8-46.1.i386.rpm
[Root @ oracle11g ~] # Rpm-Uvh readline *
Package readline-5.1-1.1 is already installed
[Root @ oracle11g ~] # Rpm-Uvh readline-devel-5.1-1.1.i386.rpm
Ii. Install rlwrap
[Root @ oracle11g ~] # Tar-zxvf rlwrap-0.30.tar.gz.zip
[Root @ oracle11g ~] # Cd rlwrap-0.30
[Root @ oracle11g rlwrap-0.30] #./configure
[Root @ oracle11g rlwrap-0.30] # make
[Root @ oracle11g rlwrap-0.30] # make install
Iii. convenient use of rlwrap
[Root @ oracle11g rlwrap-0.30] # vi/u01/oracle/. bash_profile
Add
Alias sqlplus = 'maid sqlplus'
Alias rman = 'rlwrap rman'
In Linux, SQL Plus can finally be used as in Windows.