经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 数据库/运维 » Oracle » 查看文章
源码安装rlwrap 0.43(为了方便使用linux下的sqlplus)
来源:cnblogs  作者:九命猫幺  时间:2019/7/30 10:36:06  对本文有异议

为了linux下的sqlplus方便调用历史命令和退格,安装下rlwrap,最新版本是0.43,貌似作者已经不更新了

下载地址 https://fossies.org/linux/privat/rlwrap-0.42.tar.gz/

下载后winscp传入到linux上,然后安装

  1. [root@localhost db]#ll|grep rlwrap
  2. -rw-r--r--. 1 root root 313139 Jul 30 08:50 rlwrap-0.43.tar.gz
  3. [root@localhost db]#tar -xzf rlwrap-0.43.tar.gz
  4. [root@localhost db]#mv rlwrap-0.43 /usr/local/rlwrap
  5. [root@localhost db]#cd /usr/local/rlwrap/
  6. [root@localhost rlwrap]#./configure -q
  7. configure: WARNING: No termcap nor curses library found
  8. configure: error:
  9. You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to build
  10. this program!
  11.  
  12. [root@localhost rlwrap]#yum -yq install readline*
  13. Loaded plugins: langpacks, ulninfo
  14. Ignored option -q, -v, -d or -e (probably due to merging: -yq != -y -q)
  15. Package readline-6.2-10.el7.x86_64 already installed and latest version
  16. Resolving Dependencies
  17.  
  18. (many more lines suppressed)
  19.  
  20. Installed:
  21. readline-devel.x86_64 0:6.2-10.el7
  22.  
  23. Dependency Installed:
  24. ncurses-devel.x86_64 0:5.9-14.20130511.el7_4
  25.  
  26. Complete!
  27. [root@localhost rlwrap]#./configure -q
  28. Will rlwrap find command's working directory under /proc/< commands pid>/cwd? let's see...
  29.  
  30.  
  31.  
  32. Now do:
  33. make (or gmake) to build rlwrap
  34. make check for instructions how to test it
  35. make install to install it
  36.  
  37. [root@localhost rlwrap]#make && make install
  38. make all-recursive
  39. make[1]: Entering directory `/usr/local/rlwrap'
  40. Making all in doc
  41. make[2]: Entering directory `/usr/local/rlwrap/doc'
  42. sed -e 's#@DATADIR@#/usr/local/share#' rlwrap.man > rlwrap.1
  43. make[2]: Leaving directory `/usr/local/rlwrap/doc'
  44. Making all in src
  45. make[2]: Entering directory `/usr/local/rlwrap/src'
  46. 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
  47. mv -f .deps/main.Tpo .deps/main.Po
  48. 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
  49. mv -f .deps/signals.Tpo .deps/signals.Po
  50. 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
  51. mv -f .deps/readline.Tpo .deps/readline.Po
  52. 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
  53. mv -f .deps/pty.Tpo .deps/pty.Po
  54. 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
  55. mv -f .deps/completion.Tpo .deps/completion.Po
  56. 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
  57. mv -f .deps/term.Tpo .deps/term.Po
  58. 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
  59. mv -f .deps/ptytty.Tpo .deps/ptytty.Po
  60. 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
  61. mv -f .deps/utils.Tpo .deps/utils.Po
  62. 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
  63. mv -f .deps/string_utils.Tpo .deps/string_utils.Po
  64. 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
  65. mv -f .deps/malloc_debug.Tpo .deps/malloc_debug.Po
  66. 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
  67. mv -f .deps/filter.Tpo .deps/filter.Po
  68. 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 filter.o -lutil -lreadline -ltinfo
  69. make[2]: Leaving directory `/usr/local/rlwrap/src'
  70. Making all in filters
  71. make[2]: Entering directory `/usr/local/rlwrap/filters'
  72. make[2]: Nothing to be done for `all'.
  73. make[2]: Leaving directory `/usr/local/rlwrap/filters'
  74. make[2]: Entering directory `/usr/local/rlwrap'
  75. make[2]: Leaving directory `/usr/local/rlwrap'
  76. make[1]: Leaving directory `/usr/local/rlwrap'
  77. Making install in doc
  78. make[1]: Entering directory `/usr/local/rlwrap/doc'
  79. make[2]: Entering directory `/usr/local/rlwrap/doc'
  80. make[2]: Nothing to be done for `install-exec-am'.
  81. /usr/bin/mkdir -p '/usr/local/share/man/man1'
  82. /usr/bin/install -c -m 644 rlwrap.1 '/usr/local/share/man/man1'
  83. make[2]: Leaving directory `/usr/local/rlwrap/doc'
  84. make[1]: Leaving directory `/usr/local/rlwrap/doc'
  85. Making install in src
  86. make[1]: Entering directory `/usr/local/rlwrap/src'
  87. make[2]: Entering directory `/usr/local/rlwrap/src'
  88. /usr/bin/mkdir -p '/usr/local/bin'
  89. /usr/bin/install -c rlwrap '/usr/local/bin'
  90. make[2]: Nothing to be done for `install-data-am'.
  91. make[2]: Leaving directory `/usr/local/rlwrap/src'
  92. make[1]: Leaving directory `/usr/local/rlwrap/src'
  93. Making install in filters
  94. make[1]: Entering directory `/usr/local/rlwrap/filters'
  95. make[2]: Entering directory `/usr/local/rlwrap/filters'
  96. make[2]: Nothing to be done for `install-exec-am'.
  97. /usr/bin/mkdir -p '/usr/local/share/man/man3'
  98. /usr/bin/install -c -m 644 RlwrapFilter.3pm '/usr/local/share/man/man3'
  99. make[2]: Leaving directory `/usr/local/rlwrap/filters'
  100. make[1]: Leaving directory `/usr/local/rlwrap/filters'
  101. make[1]: Entering directory `/usr/local/rlwrap'
  102. make[2]: Entering directory `/usr/local/rlwrap'
  103. make[2]: Nothing to be done for `install-exec-am'.
  104. /usr/bin/mkdir -p '/usr/local/share/rlwrap'
  105. /usr/bin/mkdir -p '/usr/local/share/rlwrap/filters'
  106. /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/count_in_prompt.py filters/ftp_filter.py '/usr/local/share/rlwrap/filters'
  107. /usr/bin/mkdir -p '/usr/local/share/rlwrap/completions'
  108. /usr/bin/install -c -m 644 completions/testclient completions/coqtop '/usr/local/share/rlwrap/completions'
  109. make install-data-hook
  110. make[3]: Entering directory `/usr/local/rlwrap'
  111. chmod a+x /usr/local/share/rlwrap/filters/*
  112. make[3]: Leaving directory `/usr/local/rlwrap'
  113. make[2]: Leaving directory `/usr/local/rlwrap'
  114. make[1]: Leaving directory `/usr/local/rlwrap'
  115. [root@localhost rlwrap]#

添加一条别名sql到oracle用户的环境变量中并使之生效,测试后上下左右键在sqlplus中均良好使用,提升了一大截sqlplus中的代码体验

  1. [oracle@localhost ~]$ cat .bashrc|grep sql
  2. alias sql='rlwrap sqlplus / as sysdba'
  3. [oracle@localhost ~]$ . .bashrc
  4. [oracle@localhost ~]$ sql
  5.  
  6. SQL*Plus: Release 11.2.0.1.0 Production on Tue Jul 30 09:41:05 2019
  7.  
  8. Copyright (c) 1982, 2009, Oracle. All rights reserved.
  9.  
  10.  
  11. Connected to:
  12. Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  13. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  14.  
  15. 09:41:05 SYS@study> select 1 from dual;
  16.  
  17. 1
  18. ----------
  19. 1
  20.  
  21. Elapsed: 00:00:00.00
  22. 09:41:11 SYS@study> select 1 from dual;

原文链接:http://www.cnblogs.com/yongestcat/p/11268124.html

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号