Quer usar setinha pra cima, histórico e edição bacana no sqlplus e rman?
Abaixo vai o passo a passo no Linux 7 (Oracle Linux 7, CentOS 7 ou RHEL 7), usando compilação do código-fonte.
1. Instalar dependências
Bash
sudo yum install -y readline readline-devel gcc make ncurses-devel autoconf automake unzip
sudo yum install -y ncurses ncurses-libs ncurses-devel ncurses-compat-libs pkgconfig
Bash
[root@srvora3]# sudo yum install -y readline readline-devel gcc make ncurses-devel autoconf automake unzip
Loaded plugins: langpacks, ulninfo
ol7_UEKR6 | 3.0 kB 00:00:00
ol7_latest | 3.6 kB 00:00:00
(1/4): ol7_UEKR6/x86_64/updateinfo | 1.3 MB 00:00:00
(2/4): ol7_latest/x86_64/updateinfo | 3.7 MB 00:00:01
(3/4): ol7_latest/x86_64/primary_db | 54 MB 00:00:11
(4/4): ol7_UEKR6/x86_64/primary_db | 88 MB 00:00:14
Package readline-6.2-11.el7.x86_64 already installed and latest version
Package gcc-4.8.5-44.0.3.el7.x86_64 already installed and latest version
Package 1:make-3.82-24.el7.x86_64 already installed and latest version
Package autoconf-2.69-11.el7.noarch already installed and latest version
Package automake-1.13.4-3.el7.noarch already installed and latest version
Package unzip-6.0-24.0.1.el7_9.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package ncurses-devel.x86_64 0:5.9-14.20130511.el7_4 will be installed
---> Package readline-devel.x86_64 0:6.2-11.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================================================================
Installing:
ncurses-devel x86_64 5.9-14.20130511.el7_4 ol7_latest 712 k
readline-devel x86_64 6.2-11.el7 ol7_latest 138 k
Transaction Summary
==========================================================================================================================================================================================
Install 2 Packages
Total download size: 850 k
Installed size: 2.4 M
Downloading packages:
(1/2): ncurses-devel-5.9-14.20130511.el7_4.x86_64.rpm | 712 kB 00:00:00
(2/2): readline-devel-6.2-11.el7.x86_64.rpm | 138 kB 00:00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.3 MB/s | 850 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
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:
ncurses-devel.x86_64 0:5.9-14.20130511.el7_4 readline-devel.x86_64 0:6.2-11.el7
Complete!
[root@srvora3]#
[root@srvora3]# yum -y install ncurses ncurses-libs ncurses-devel ncurses-compat-libs pkgconfig
Loaded plugins: langpacks, ulninfo
ol7_UEKR6 | 3.0 kB 00:00:00
ol7_latest | 3.6 kB 00:00:00
Package ncurses-5.9-14.20130511.el7_4.x86_64 already installed and latest version
Package ncurses-libs-5.9-14.20130511.el7_4.x86_64 already installed and latest version
No package ncurses-compat-libs available.
Package 1:pkgconfig-0.27.1-4.el7.x86_64 already installed and latest version
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
--> 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:
ncurses-devel x86_64 5.9-14.20130511.el7_4 ol7_latest 712 k
Transaction Summary
==========================================================================================================================================================================================================================================
Install 1 Package
Total download size: 712 k
Installed size: 2.1 M
Downloading packages:
ncurses-devel-5.9-14.20130511.el7_4.x86_64.rpm | 712 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ncurses-devel-5.9-14.20130511.el7_4.x86_64 1/1
Verifying : ncurses-devel-5.9-14.20130511.el7_4.x86_64 1/1
Installed:
ncurses-devel.x86_64 0:5.9-14.20130511.el7_4
Complete!
[root@srvora3]#
2. Baixar e descompactar o código‑fonte
Bash
cd /tmp
wget --no-check-certificate https://codeload.github.com/hanslub42/rlwrap/zip/refs/heads/master -O rlwrap-master.zip
unzip -o -q rlwrap-master.zip
cd rlwrap-master
ls -ltra
Bash
[root@srvora3 ~]# cd /tmp
[root@srvora3 tmp]# wget --no-check-certificate https://codeload.github.com/hanslub42/rlwrap/zip/refs/heads/master -O rlwrap-master.zip
--2025-09-20 23:26:04-- https://codeload.github.com/hanslub42/rlwrap/zip/refs/heads/master
Resolving codeload.github.com (codeload.github.com)... 4.228.31.148
Connecting to codeload.github.com (codeload.github.com)|4.228.31.148|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/zip]
Saving to: ‘rlwrap-master.zip’
[ <=> ] 224,015 --.-K/s in 0.03s
2025-09-20 23:26:04 (6.52 MB/s) - ‘rlwrap-master.zip’ saved [224015]
[root@srvora3 tmp]# unzip -o -q rlwrap-master.zip
[root@srvora3 tmp]# cd rlwrap-master/
[root@srvora3 rlwrap-master]# ls -ltra
total 116
drwxr-xr-x. 2 root root 38 Aug 22 15:20 test
drwxr-xr-x. 2 root root 4096 Aug 22 15:20 src
-rw-r--r--. 1 root root 3880 Aug 22 15:20 README.md
-rw-r--r--. 1 root root 27605 Aug 22 15:20 NEWS
-rw-r--r--. 1 root root 2183 Aug 22 15:20 Makefile.am
-rw-r--r--. 1 root root 3763 Aug 22 15:20 INSTALL
-rw-r--r--. 1 root root 298 Aug 22 15:20 .gitignore
drwxr-xr-x. 2 root root 4096 Aug 22 15:20 filters
drwxr-xr-x. 2 root root 46 Aug 22 15:20 doc
-rw-r--r--. 1 root root 17992 Aug 22 15:20 COPYING
-rw-r--r--. 1 root root 21692 Aug 22 15:20 configure.ac
drwxr-xr-x. 2 root root 38 Aug 22 15:20 completions
-rw-r--r--. 1 root root 105 Aug 22 15:20 ChangeLog
-rw-r--r--. 1 root root 2353 Aug 22 15:20 BUGS
-rw-r--r--. 1 root root 982 Aug 22 15:20 AUTHORS
drwxr-xr-x. 7 root root 4096 Aug 22 15:20 .
drwxrwxrwt. 9 root root 4096 Sep 20 23:27 ..
[root@srvora3 rlwrap-master]#
⚠️ Se não der certo (erro de SSL/TLS):
➡️ Baixe no seu computador rlwrap-master.zip
https://codeload.github.com/hanslub42/rlwrap/zip/refs/heads/master
ou
http://dbasobrinho.com.br/get/rlwrap-master.zip
Depois transfira pro servidor via scp: scp rlwrap-master.zip root@seu-servidor:/tmp/
3. Configurar o build
Bash
pwd
autoreconf -i
./configure --without-libptytty
Bash
[root@srvora3 rlwrap-master]# pwd
/tmp/rlwrap-master
[root@srvora3 rlwrap-master]# autoreconf -i
configure.ac:32: installing 'tools/config.guess'
configure.ac:32: installing 'tools/config.sub'
configure.ac:34: installing 'tools/install-sh'
configure.ac:34: installing 'tools/missing'
parallel-tests: installing 'tools/test-driver'
src/Makefile.am: installing 'tools/depcomp'
[root@srvora3 rlwrap-master]#
[root@srvora3 rlwrap-master]# autoreconf -i
[root@srvora3 rlwrap-master]# ./configure --without-libptytty
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... /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 for style of include used by make... GNU
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 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 for ptytty_create in -lptytty... no
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 sys/wait.h that is POSIX.1 compatible... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/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 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 libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.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/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.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 sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/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... yes
checking curses.h presence... yes
checking for curses.h... yes
checking stropts.h usability... no
checking stropts.h presence... no
checking for stropts.h... no
checking termcap.h usability... yes
checking termcap.h presence... yes
checking for termcap.h... yes
checking util.h usability... no
checking util.h presence... no
checking for util.h... no
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking for term.h... yes
checking for ncurses/term.h... yes
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 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 pselect... yes
checking for sched_yield... yes
checking for setitimer... yes
checking for setsid... yes
checking for setrlimit... yes
checking for sigaction... yes
checking for system... yes
checking whether mkstemps is declared... yes
checking whether snprintf is declared... yes
checking whether strlcat is declared... no
checking whether strnlen is declared... yes
checking whether setenv is declared... yes
checking whether putenv is declared... yes
checking whether readlink is declared... yes
checking whether nice is declared... 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 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 -ltinfo... yes
checking for readline in -lreadline... yes
checking for tigetnum... yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... 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/12540/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
Trying to backdate src/completion.rb a few secs in order to prevent a spurious call to a (possibly not installed) helper 'rbgen'
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
[root@srvora3 rlwrap-master]#
4. Compilar
Bash
make
Bash
[root@srvora3 rlwrap-master]# make
make all-recursive
make[1]: Entering directory `/tmp/rlwrap-master'
Making all in doc
make[2]: Entering directory `/tmp/rlwrap-master/doc'
sed -e 's#@DATADIR@#/usr/local/share#' rlwrap.man > rlwrap.1
make[2]: Leaving directory `/tmp/rlwrap-master/doc'
Making all in src
make[2]: Entering directory `/tmp/rlwrap-master/src'
gcc -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 -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 -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 -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 -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 -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 -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
mv -f .deps/ptytty.Tpo .deps/ptytty.Po
gcc -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 -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 -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 -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 -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 -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 `/tmp/rlwrap-master/src'
Making all in filters
make[2]: Entering directory `/tmp/rlwrap-master/filters'
pod2man --section=3pm RlwrapFilter.pm > RlwrapFilter.3pm
make[2]: Leaving directory `/tmp/rlwrap-master/filters'
make[2]: Entering directory `/tmp/rlwrap-master'
make[2]: Leaving directory `/tmp/rlwrap-master'
make[1]: Leaving directory `/tmp/rlwrap-master'
[root@srvora3 rlwrap-master]#
5. Instalar
Bash
sudo make install
Bash
[root@srvora3 rlwrap-master]# sudo make install
Making install in doc
make[1]: Entering directory `/tmp/rlwrap-master/doc'
make[2]: Entering directory `/tmp/rlwrap-master/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 `/tmp/rlwrap-master/doc'
make[1]: Leaving directory `/tmp/rlwrap-master/doc'
Making install in src
make[1]: Entering directory `/tmp/rlwrap-master/src'
make[2]: Entering directory `/tmp/rlwrap-master/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 `/tmp/rlwrap-master/src'
make[1]: Leaving directory `/tmp/rlwrap-master/src'
Making install in filters
make[1]: Entering directory `/tmp/rlwrap-master/filters'
make[2]: Entering directory `/tmp/rlwrap-master/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 `/tmp/rlwrap-master/filters'
make[1]: Leaving directory `/tmp/rlwrap-master/filters'
make[1]: Entering directory `/tmp/rlwrap-master'
make[2]: Entering directory `/tmp/rlwrap-master'
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 filters/nl_and_then_prompt.py '/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 `/tmp/rlwrap-master'
chmod a+x /usr/local/share/rlwrap/filters/*
make[3]: Leaving directory `/tmp/rlwrap-master'
make[2]: Leaving directory `/tmp/rlwrap-master'
make[1]: Leaving directory `/tmp/rlwrap-master'
[root@srvora3 rlwrap-master]#
6. Testar
Bash
rlwrap --version
rm -rf rlwrap-master.zip rlwrap-master
Bash
[root@srvora3 rlwrap-master]# rlwrap --version
rlwrap 0.47.1
[root@srvora3 rlwrap-master]# rm -rf rlwrap-master.zip rlwrap-master
[root@srvora3 rlwrap-master]#
[root@srvora3 rlwrap-master]#
7 . Pós-instalação
Crie aliases úteis pro usuário oracle
(ou seu usuário):
Bash
rlwrap sqlplus / as sysdba
rlwrap rman target /
## ou ##
echo "alias sqlplus='rlwrap sqlplus'" >> ~/.bashrc
echo "alias rman='rlwrap rman'" >> ~/.bashrc
source ~/.bashrc
Sem mistério: baixe o rlwrap-master.zip
, descompacte, compile e instale. Depois é só jogar os aliases no .bashrc
e ser feliz no sqlplus com histórico e edição decentes 😄.
#20250920 #DBASobrinho #GuinaNãoTinhaDó #BóBó #CaceteDeAgulha #OracleACE