Oracle的SQL Plus默认不能使用上下键翻页,对于一个长期使用SQL Plus的用户来说实在不能忍受,为了支持使用上下键翻页,我们需要安装插件,本文介绍如何安装。我们需要IO-Tty-1.07.tar.gz、Term-ReadLine-Gnu-1.16.tar.gz、uniread-1.01.tar.gz三个文件,安装顺序如下:IO-Tty-1.07.tar.gz、Term-ReadLine-Gnu-1.16.tar.gz、uniread-1.01.tar.gz。
IO-Tty-1.07.tar.gz
http://download.csdn.net/detail/wentasy/6677797
Term-ReadLine-Gnu-1.16.tar.gz
http://download.csdn.net/detail/wentasy/6677803
uniread-1.01.tar.gz(因为文件上传到CSDN资源无法显示,所以把这个文件传到我的百度网盘,供大家下载)
http://pan.baidu.com/s/1tflOr
第一步,准备工作,安装perl
[root@serv01 ~]# yum install perl* -y
第二步,拷贝文件
[root@larrywen uniread]# scp scp IO-Tty-1.07.tar.gz Term-ReadLine-Gnu-1.16.tar.gz uniread-1.01.tar.gz 192.168.1.11:/opt/
第三步,解压这三个文件
[root@serv01 opt]# tar -xzvf IO-Tty-1.07.tar.gz [root@serv01 opt]# tar -xzvf Term-ReadLine-Gnu-1.16.tar.gz [root@serv01 opt]# tar -xzvf uniread-1.01.tar.gz
第四步,进入IO-Tty-1.07目录,安装IO-Tty-1.07
[root@serv01 opt]# cd IO-Tty-1.07 [root@serv01 IO-Tty-1.07]# perl Makefile.PL [root@serv01 IO-Tty-1.07]# make && make install
第五步,进入Term-ReadLine-Gnu-1.16目录,安装Term-ReadLine-Gnu-1.16
[root@serv01 IO-Tty-1.07]# cd ../Term-ReadLine-Gnu-1.16 [root@serv01 Term-ReadLine-Gnu-1.16]# perl Makefile.PL Could not find neither libtermcap.a, libncurses.a, or libcurses.
第六步,在编译时报错,我们安装如下包:ncurses*、*readline*、cyrus-imapd*,然后再重新编译、安装
[root@serv01 Term-ReadLine-Gnu-1.16]# yum install cyrus-imapd* -y [root@serv01 Term-ReadLine-Gnu-1.16]# yum install ncurses* -y [root@serv01 Term-ReadLine-Gnu-1.16]# yum install "*readline*" -y [root@serv01 Term-ReadLine-Gnu-1.16]# perl Makefile.PL [root@serv01 Term-ReadLine-Gnu-1.16]# make && make install
第七步,进入uniread-1.01目录,安装uniread-1.01
[[email protected]]# cd ../uniread-1.01 [root@serv01 uniread-1.01]# perl Makefile.PL [root@serv01 uniread-1.01]# make && make install
第八步,在执行sqlplus / as sysdba之前加上uniread命令,就可以使用上下键翻页。我们还可以在环境变量添加别名,比如alias sqlplus=" uniread sqlplus / as sysdba"
[oracle@serv01 ~]$ uniread sqlplus / as sysdba
#!/bin/bash #Author:Wentasy #Desc:Auto Install SQL*Plus Plugin-Uniread #1.Install dependency yum install perl* -y yum install ncurses* cyrus-imapd* "*readline*" -y #2.Unzip install files tar -xzvf /opt/IO-Tty-1.07.tar.gz -C /opt tar -xzvf /optTerm-ReadLine-Gnu-1.16.tar.gz -C /opt tar -xzvf /opt/uniread-1.01.tar.gz -C /opt #3.Install IO-Tty /opt/IO-Tty-1.07/perl Makefile.PL /opt/IO-Tty-1.07/make && make install #4.Install Term readline /opt/Term-ReadLine-Gnu-1.16/perl Makefile.PL /opt/Term-ReadLine-Gnu-1.16/make && make install #5.Install uniread /opt/uniread-1.01/perl Makefile.PL /opt/uniread-1.01/make && make install #6.Set env Variables echo "alias sqlplus=\"uniread sqlplus / as sysdba\"" >> /home/oracle/.bash_profile source /home/oracle/.bash_profile
我的邮箱:[email protected] 新浪微博:@jutdb 微信公众平台:JustOracle(微信号:justoracle) 数据库技术交流群:336882565(加群时验证 From CSDN XXX) All is well 2013年12月22日 By Larry Wen
@Wentasy 博文仅供参考,欢迎大家来访。如有错误之处,希望批评指正。原创博文如需转载请注明出处,谢谢 :) [CSDN博客] |