Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution to the problem that sqlplus cannot use the command backspace deletion and history under Oracle-- use rlwrap

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Generally speaking, when you remotely log in to oracle under Linux through SSH clients such as SecureCRT or putty, you will use sqplus to connect to the database. When you press Backspace or Del key to delete the wrong characters, ^ H or other messy characters will appear, which will feel very uncomfortable and unaccustomed, and affect the efficiency of use. In view of this problem, a brief summary is made.

First, install the corresponding software package

First configure the local YUM source

And then

Yum-y install readline*

Running Transaction

Installing: ncurses-devel-5.7-3.20090208.el6.x86_64 1 Compact 2

Installing: readline-devel-6.0-4.el6.x86_64 2 Compact 2

Installed products updated.

Verifying: readline-devel-6.0-4.el6.x86_64 1 Compact 2

Verifying: ncurses-devel-5.7-3.20090208.el6.x86_64 2 Compact 2

Wait for the installation to complete

Then download the rlwrap-0.37.tar package from the Internet

[root@rac1 home] # tar-xvf rlwrap-0.37.tar

[root@rac1 home] # cd rlwrap-0.37

[root@rac1 rlwrap-0.37] # ls-l

Total dosage 472

-rw-rw-r-- 1 500 500 35 029 April 30 2010 aclocal.m4

-rw-r--r-- 1 500 500 638 August 15 2006 AUTHORS

-rw-r--r-- 1 500 500 4267 May 5 2010 BUGS

-rw-r--r-- 1 500 500 105 August 10 2003 ChangeLog

Drwxrwxr-x 2 500 500 4096 May 5 2010 completions

-rw-rw-r-- 1 500 500 7 042 April 30 2010 config.h.in

-rw-r--r-- 1 root root 67839 September 1 17:00 config.log

-rwxr-xr-x 1 500 500 22 2847 April 30 2010 configure

-rw-r--r-- 1 500 500 11 521 April 30 2010 configure.ac

-rw-r--r-- 1 500 500 17 992 August 8 2006 COPYING

Drwxrwxr-x 2 500 500 4096 May 5 2010 doc

Drwxrwxr-x 2 500 500 4096 May 5 2010 filters

-rw-r--r-- 1 500 500 2019 November 23 2009 INSTALL

-rw-r--r-- 1 500 500 1 272 January 23 2010 Makefile.am

-rw-rw-r-- 1 500 500 28316 April 30 2010 Makefile.in

-rw-r--r-- 1 500 500 16788 April 30 2010 NEWS

-rw-r--r-- 1 500 500 1 394 October 24 2007 PLEA

-rw-r--r-- 1 500 500 3070 January 8 2010 README

Drwxrwxr-x 2 500 500 4096 May 5 2010 src

Drwxrwxr-x 2 500 500 4096 May 5 2010 test

-rw-r--r-- 1 500 500 310 April 16 2010 TODO

Drwxrwxr-x 2 500 500 4096 May 5 2010 tools

[root@rac1 rlwrap-0.37] #. / configure

Checking build system type... X86_64-unknown-linux-gnu

Checking host system type... X86_64-unknown-linux-gnu

Checking for a BSD-compatible install... / usr/bin/install-c

Checking whether build environment is sane... Yes

Checking for a thread-safe mkdir-p. / bin/mkdir-p

[root@rac1 rlwrap-0.37] # make

[root@rac1 rlwrap-0.37] # make install

Two: configure to use rlwrap

[root@oracle11g rlwrap-0.30] # vi / home/oracle/.bash_profile

Add at the head or tail

Alias sqlplus='rlwrap sqlplus'

Alias lsnrctl='rlwrap lsnrctl'

Alias rman='rlwrap rman'

Stty erase ^ h

If the rlwrap command cannot be found, configure PATH

PATH=$PATH:$HOME/bin:/home/rlwrap-0.37/src

Make the modified variable execution effective

# source .bash _ profile

three。 Enter the oracle connection user test

# su-oracle

Sqlplus / as sysdba

SQL > show user

Later, when you use the command sqlplus / as sysdba to connect to the database, the tool rlwrap will be called, so that SQL Plus under Linux can be used as under Windows.

Add: if the sqlplus command is not available, you can set it as follows

[oracle@rac1 ~] $sqlplus / nolog

Bash: sqlplus: command not found

[oracle@rac1 ~] $ln-s $ORACLE_HOME/bin/sqlplus / usr/bin

Ln: creating symbolic link `/ usr/bin/sqlplus' to` / bin/sqlplus': Permission deni ed

[oracle@rac1 ~] $su-root

Password:

[root@rac1 ~] # ln-s $ORACLE_HOME/bin/sqlplus / usr/bin

[root@rac1 ~] # su-oracle

[oracle@rac1 ~] $sqlplus / nolog

SQL > conn / as sysdba

Connected to an idle instance.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report