sqlplus在使用退格键出现乱码

文章描述了在使用SQL*Plus时遇到光标键显示乱码的问题,解决方案是安装readline、readline-dev等相关库,通过编译和配置rlwrap工具来修复。详细步骤包括下载、解压、配置、安装readline和rlwrap,最后通过修改.bash_profile文件设置别名,使sqlplus命令通过rlwrap运行,解决了光标键的正常使用问题。
摘要由CSDN通过智能技术生成

https://zhuanlan.zhihu.com/p/571737575
参考:https://blog.csdn.net/qdseashore/article/details/52534388

问题sqlplus 光标键显示乱码,不能正常使用


[oracle@rhel ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jul 5 08:35:04 2023
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> sel^H^H^H^H^H^H^H
SP2-0042: unknown comma" - rest of line ignored.

解决办法
需要安装readline、readline-dev、rlwarp readline和readline-dev 在CentOS6、7的ios光盘里就有,直接安装就可以

1、 下载

https://pan.baidu.com/s/1SPRD1hzGmkbXCYD4-HcvXQ 密码:hpjn
下载rlwrap-0.37.tar.gz,然后上传到相应目录
2.安装

[root@rhel Downloads]# gzip -d rlwrap-0.37.tar.gz
[root@rhel Downloads]# tar -xvf rlwrap-0.37.tar
[root@rhel Downloads]# cd rlwrap-0.46.1/

[root@localhost rlwrap-0.37]# ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-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
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking whether build environment is sane... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for perl... /usr/bin/perl
checking for strip... strip
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking libutil.h usability... no
checking libutil.h presence... no
checking for libutil.h... no
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking for sys/wait.h... (cached) yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking for stdint.h... (cached) yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking regex.h usability... yes
checking regex.h presence... yes
checking for regex.h... yes
checking curses.h usability... no
checking curses.h presence... no
checking for curses.h... no
checking termcap.h usability... no
checking termcap.h presence... no
checking for termcap.h... no
checking for term.h... no
checking for ncurses/term.h... no
checking argument type of tputs putc function... char
checking whether your getopt() correctly understands double colons in option string... yes
checking for an ANSI C-conforming const... yes
checking for pid_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether gcc needs -traditional... no
checking return type of signal handlers... void
checking for getopt_long... yes
checking for getopt_long... (cached) yes
checking for isastream... yes
checking for mkstemp... yes
checking for pselect... yes
checking for putenv... yes
checking for readlink... yes
checking for sched_yield... yes
checking for setenv... yes
checking for setitimer... yes
checking for setsid... yes
checking for setrlimit... yes
checking for sigaction... yes
checking for snprintf... yes
checking for strlcpy... no
checking for strlcat... no
checking for strnlen... yes
checking for system... yes
checking for openpty in -lutil... yes
checking for openpty... yes
checking for getpty... no
checking for grantpt... yes
checking for unlockpt... yes
checking for getpt... yes
checking for pty/tty type... checking pty.h usability... yes
checking pty.h presence... yes
checking for pty.h... yes
OPENPTY
configure: checking for pty ranges...
checking for tgetent... no
checking for tgetent in -lcurses... yes
checking for readline in -lreadline... no
configure: error:

You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to build
this program!


[root@localhost rlwrap-0.37]# make
make: *** No targets specified and no makefile found.  Stop.

出现上面错误是因为缺少三个安装包:
readline-devel-6.2-11.el7.x86_64
readline-6.2-11.el7.x86_64
ncurses-devel-5.9-14.20130511.el7_4.x86_64

2\以上安装包在安装光盘中可以找到,配置本地源

[root@rhel rlwrap-0.46.1]# df -Th            
Filesystem            Type      Size  Used Avail Use% Mounted on
devtmpfs              devtmpfs  3.9G     0  3.9G   0% /dev
tmpfs                 tmpfs     3.9G     0  3.9G   0% /dev/shm
tmpfs                 tmpfs     3.9G   13M  3.9G   1% /run
tmpfs                 tmpfs     3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/mapper/rhel-root xfs        29G  7.8G   21G  28% /
/dev/sda1             xfs       1.9G  169M  1.8G   9% /boot
/dev/mapper/rhel-u01  xfs        20G   14G  6.9G  66% /u01
tmpfs                 tmpfs     797M   36K  797M   1% /run/user/0
/dev/sr0              iso9660   4.2G  4.2G     0 100% /run/media/root/RHEL-7.7 Server.x86_64
[root@rhel rlwrap-0.46.1]# mount /dev/sr0 /mnt/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
[root@rhel rlwrap-0.46.1]# df -Th
Filesystem            Type      Size  Used Avail Use% Mounted on
devtmpfs              devtmpfs  3.9G     0  3.9G   0% /dev
tmpfs                 tmpfs     3.9G     0  3.9G   0% /dev/shm
tmpfs                 tmpfs     3.9G   13M  3.9G   1% /run
tmpfs                 tmpfs     3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/mapper/rhel-root xfs        29G  7.8G   21G  28% /
/dev/sda1             xfs       1.9G  169M  1.8G   9% /boot
/dev/mapper/rhel-u01  xfs        20G   14G  6.9G  66% /u01
tmpfs                 tmpfs     797M   36K  797M   1% /run/user/0
/dev/sr0              iso9660   4.2G  4.2G     0 100% /mnt/cdrom
[root@rhel rlwrap-0.46.1]# 

3yum安装 readline*

[root@rhel rlwrap-0.46.1]# yum install -y readline*
This system is not registered with an entitlement server. You can use subscription-manager to register.
media                                  


                  | 2.8 kB     00:00     
Package readline-6.2-11.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package readline-devel.x86_64 0:6.2-11.el7 will be installed
--> Processing Dependency: ncurses-devel for package: readline-devel-6.2-11.el7.x86_64
--> Running transaction check
---> Package ncurses-devel.x86_64 0:5.9-14.20130511.el7_4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package             Arch        Version                       Repository  Size
================================================================================
Installing:
 readline-devel      x86_64      6.2-11.el7                    media      139 k
Installing for dependencies:
 ncurses-devel       x86_64      5.9-14.20130511.el7_4         media      713 k

Transaction Summary
================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 851 k
Installed size: 2.4 M
Downloading packages:
--------------------------------------------------------------------------------
Total                                               11 MB/s | 851 kB  00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : ncurses-devel-5.9-14.20130511.el7_4.x86_64                   1/2 
  Installing : readline-devel-6.2-11.el7.x86_64                             2/2 
  Verifying  : readline-devel-6.2-11.el7.x86_64                             1/2 
  Verifying  : ncurses-devel-5.9-14.20130511.el7_4.x86_64                   2/2 

Installed:
  readline-devel.x86_64 0:6.2-11.el7                                            

Dependency Installed:
  ncurses-devel.x86_64 0:5.9-14.20130511.el7_4                                  

Complete!
[root@rhel rlwrap-0.46.1]# rpm -qa |grep read  
perl-threads-1.87-4.el7.x86_64
perl-Thread-Queue-3.02-2.el7.noarch
perl-threads-shared-1.43-6.el7.x86_64
boost-thread-1.53.0-27.el7.x86_64
libdvdread-5.0.3-3.el7.x86_64
readline-devel-6.2-11.el7.x86_64
readline-6.2-11.el7.x86_64
[root@rhel rlwrap-0.46.1]# yum install -y libtermcap-devel*
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
              : manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Package ncurses-devel-5.9-14.20130511.el7_4.x86_64 already installed and latest version
Nothing to do
[root@rhel rlwrap-0.46.1]# make
make: *** No targets specified and no makefile found.  Stop.

重新安装rlwrap

[root@rhel rlwrap-0.46.1]# ./configure 
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make sets $(MAKE)... (cached) yes
checking whether build environment is sane... yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... -std=gnu11
checking whether gcc -std=gnu11 understands -c and -o together... yes
checking dependency style of gcc -std=gnu11... gcc3
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) -std=gnu11
checking whether gcc -std=gnu11 understands -c and -o together... (cached) yes
checking dependency style of gcc -std=gnu11... (cached) gcc3
checking how to run the C preprocessor... gcc -std=gnu11 -E
checking for perl... /usr/bin/perl
checking for strip... strip
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for errno.h... yes
checking for fcntl.h... yes
checking for libgen.h... yes
checking for libutil.h... no
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for sched.h... yes
checking for sys/file.h... yes
checking for sys/ioctl.h... yes
checking for sys/wait.h... (cached) yes
checking for sys/resource.h... yes
checking for stddef.h... yes
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking for stdint.h... (cached) yes
checking for time.h... yes
checking for sys/time.h... yes
checking for getopt.h... yes
checking for regex.h... yes
checking for curses.h... yes
checking for stropts.h... no
checking for termcap.h... yes
checking for util.h... no
checking for term.h... yes
checking for ncurses/term.h... yes
checking for gcc -std=gnu11 options needed to detect all undeclared functions... none needed
checking whether PROC_PIDVNODEPATHINFO is declared... no
checking whether procstat_open_sysctl is declared... no
checking whether procstat_getprocs is declared... no
checking whether procstat_getfiles is declared... no
checking whether STAILQ_FOREACH is declared... no
checking argument type of tputs putc function... int
checking for an ANSI C-conforming const... yes
checking for pid_t... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether gcc -std=gnu11 needs -traditional... no
checking for getopt_long... yes
checking for basename... yes
checking for dirname... yes
checking for flock... yes
checking for getopt_long... (cached) yes
checking for isastream... yes
checking for mkstemps... yes
checking for pselect... yes
checking for putenv... yes
checking for readlink... yes
checking for sched_yield... yes
checking for setenv... yes
checking for setitimer... yes
checking for setsid... yes
checking for setrlimit... yes
checking for sigaction... yes
checking for snprintf... yes
checking for strlcpy... no
checking for strlcat... no
checking for strnlen... yes
checking for system... yes
checking for openpty in -lutil... yes
checking for openpty... yes
checking for getpty... no
checking for grantpt... yes
checking for unlockpt... yes
checking for getpt... 
checking for pty/tty type... checking for pty.h... yes
OPENPTY
configure: checking for pty ranges
checking for tgetent... no
checking for tgetent in -ltinfo... yes
checking for readline in -lreadline... yes
checking for tigetnum... yes
checking for readline/readline.h... yes
checking whether your readline headers and library know about rl_set_screen_size... yes
checking whether your readline headers and library know about rl_basic_quote_characters... yes
checking whether your readline headers and library know about rl_variable_value... yes
checking whether your readline headers and library know about rl_readline_version... yes
checking whether your readline headers and library know about rl_executing_keyseq... no
checking whether the private symbol _rl_horizontal_scroll_mode is visble in your readline libs... yes
Will rlwrap find command's working directory under /proc/<commands pid>/cwd? let's see...
checking for /proc/91663/cwd/configure.ac... yes
checking whether we can find command line under <opt_proc_mountpoint>/<pid>/cmdline and mirror it by overwriting our own *argv (this may take a few secs)... yes


checking that generated files are newer than configure... done
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating filters/Makefile
config.status: creating doc/Makefile
config.status: creating src/Makefile
config.status: creating doc/rlwrap.man
config.status: creating config.h
config.status: executing depfiles commands

Now do:
    make (or gmake)  to build rlwrap
    make check       for instructions how to test it
    make install     to install it

make

[root@rhel rlwrap-0.46.1]# make
make  all-recursive
make[1]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1'
Making all in doc
make[2]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1/doc'
sed -e 's#@DATADIR@#/usr/local/share#'  rlwrap.man > rlwrap.1
make[2]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1/doc'
Making all in src
make[2]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1/src'
gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c
mv -f .deps/main.Tpo .deps/main.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT signals.o -MD -MP -MF .deps/signals.Tpo -c -o signals.o signals.c
mv -f .deps/signals.Tpo .deps/signals.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT readline.o -MD -MP -MF .deps/readline.Tpo -c -o readline.o readline.c
mv -f .deps/readline.Tpo .deps/readline.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT pty.o -MD -MP -MF .deps/pty.Tpo -c -o pty.o pty.c
mv -f .deps/pty.Tpo .deps/pty.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT completion.o -MD -MP -MF .deps/completion.Tpo -c -o completion.o completion.c
mv -f .deps/completion.Tpo .deps/completion.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT term.o -MD -MP -MF .deps/term.Tpo -c -o term.o term.c
mv -f .deps/term.Tpo .deps/term.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT ptytty.o -MD -MP -MF .deps/ptytty.Tpo -c -o ptytty.o ptytty.c
ptytty.c: In function ‘ptytty_control_tty’:
ptytty.c:257:5: warning: implicit declaration of function ‘isastream’ [-Wimplicit-function-declaration]
     if (isastream(fd_tty) == 1) {
     ^
mv -f .deps/ptytty.Tpo .deps/ptytty.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT utils.o -MD -MP -MF .deps/utils.Tpo -c -o utils.o utils.c
mv -f .deps/utils.Tpo .deps/utils.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT string_utils.o -MD -MP -MF .deps/string_utils.Tpo -c -o string_utils.o string_utils.c
mv -f .deps/string_utils.Tpo .deps/string_utils.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT malloc_debug.o -MD -MP -MF .deps/malloc_debug.Tpo -c -o malloc_debug.o malloc_debug.c
mv -f .deps/malloc_debug.Tpo .deps/malloc_debug.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT multibyte.o -MD -MP -MF .deps/multibyte.Tpo -c -o multibyte.o multibyte.c
mv -f .deps/multibyte.Tpo .deps/multibyte.Po
gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT filter.o -MD -MP -MF .deps/filter.Tpo -c -o filter.o filter.c
mv -f .deps/filter.Tpo .deps/filter.Po
gcc -std=gnu11 -DDATADIR=\"/usr/local/share\"  -g -O2   -o rlwrap main.o signals.o readline.o pty.o completion.o term.o ptytty.o utils.o string_utils.o malloc_debug.o multibyte.o filter.o  -lutil   -lreadline -ltinfo
make[2]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1/src'
Making all in filters
make[2]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1/filters'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1/filters'
make[2]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1'
make[2]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1'
make[1]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1'

make install

[root@rhel rlwrap-0.46.1]# make install
Making install in doc
make[1]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1/doc'
make[2]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1/doc'
make[2]: Nothing to be done for `install-exec-am'.
 /usr/bin/mkdir -p '/usr/local/share/man/man1'
 /usr/bin/install -c -m 644 rlwrap.1 '/usr/local/share/man/man1'
make[2]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1/doc'
make[1]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1/doc'
Making install in src
make[1]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1/src'
make[2]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1/src'
 /usr/bin/mkdir -p '/usr/local/bin'
  /usr/bin/install -c rlwrap '/usr/local/bin'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1/src'
make[1]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1/src'
Making install in filters
make[1]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1/filters'
make[2]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1/filters'
make[2]: Nothing to be done for `install-exec-am'.
 /usr/bin/mkdir -p '/usr/local/share/man/man3'
 /usr/bin/install -c -m 644 RlwrapFilter.3pm '/usr/local/share/man/man3'
make[2]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1/filters'
make[1]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1/filters'
make[1]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1'
make[2]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1'
make[2]: Nothing to be done for `install-exec-am'.
 /usr/bin/mkdir -p '/usr/local/share/rlwrap'
 /usr/bin/mkdir -p '/usr/local/share/rlwrap/filters'
 /usr/bin/install -c -m 644  filters/README filters/RlwrapFilter.pm filters/RlwrapFilter.3pm filters/count_in_prompt filters/pipeto filters/logger filters/null filters/unbackspace filters/pipeline filters/ftp_filter filters/handle_hotkeys filters/history_format filters/simple_macro filters/template filters/scrub_prompt filters/paint_prompt filters/censor_passwords filters/listing filters/paint_prompt.py filters/handle_hotkeys.py filters/logger.py filters/pipeto.py filters/rlwrapfilter.py filters/null.py filters/censor_passwords.py filters/edit_history filters/count_in_prompt.py filters/ftp_filter.py filters/debug_null filters/handle_sigwinch filters/outfilter filters/makefilter filters/dissect_prompt '/usr/local/share/rlwrap/filters'
 /usr/bin/mkdir -p '/usr/local/share/rlwrap/completions'
 /usr/bin/install -c -m 644  completions/testclient completions/coqtop '/usr/local/share/rlwrap/completions'
make  install-data-hook
make[3]: Entering directory `/home/dd/Downloads/rlwrap-0.46.1'
chmod a+x /usr/local/share/rlwrap/filters/* 
make[3]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1'
make[2]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1'
make[1]: Leaving directory `/home/dd/Downloads/rlwrap-0.46.1'

验证安装结果

[root@rhel rlwrap-0.46.1]# su - oracle
Last login: Tue Jul  4 11:41:11 CST 2023 on pts/2
[oracle@rhel ~]$ rlwrap
Usage: rlwrap [options] command ...

Options:
  -a[password prompt]        --always-readline[=password prompt]
  -A                         --ansi-colour-aware
  -b  <chars>                --break-chars=<chars>
  -c                         --complete-filenames
  -C  <name|N>               --command-name=<name|N>
  -D  <0|1|2>                --history-no-dupes=<0|1|2>
  -e  <char|''>              --extra-char-after-completion=<char|''>
  -f  <completion list>      --file=<completion list>
  -g  <regexp>               --forget-matching=<regexp>
  -h                         --help
  -H  <file>                 --history-filename=<file>
  -i                         --case-insensitive
  -I                         --pass-sigint-as-sigterm
  -l  <file>                 --logfile=<file>
  -m[newline substitute]     --multi-line[=newline substitute]
;?

编辑oracle用户下的.bash_profile,增加

[root@rhel rlwrap-0.46.1]# su - oracle
Last login: Wed Jul  5 08:40:07 CST 2023 on pts/3
[oracle@rhel ~]$ vi .bash_profile  

## 增加两行
stty erase ^h
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
##在oracle下的.bash_profile中$PATH路径中增加/usr/local/bin路径

PATH=$PATH:$HOME/.local/bin:$HOME/bin:/usr/local/bin

重新登录后,使用sqlplus 光标键可正常使用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值