方法:使用rlwrap工具,
步骤:
1. 在AIX上安装gcc工具,在也多网站上都有介绍,gcc for aix的安装方法此处略。
ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gcc/
gcc-4.2.0-3.aix6.1.ppc.rpm,
gcc-cplusplus-4.2.0-3.aix6.1.ppc.rpm,
libgcc-4.2.0-3.aix6.1.ppc.rpm,
libstdcplusplus-4.2.0-3.aix6.1.ppc.rpm,
libstdcplusplus-devel-4.2.0-3.aix6.1.ppc.rpm
用ftp将上述五个rpm文件上传到/usr/opt/freeware/src /packages/SOURCES目录下
以root身份在/usr/opt/freeware/src/packages/SOURCES执行命令
# rpm -ivh gcc-4.2.0-3.aix6.1.ppc.rpm
# rpm -ivh libgcc-4.2.0-3.aix6.1.ppc.rpm
# rpm -ivh libstdcplusplus-4.2.0-3.aix6.1.ppc.rpm
# rpm -ivh libstdcplusplus-devel-4.2.0-3.aix6.1.ppc.rpm
# rpm -ivh gcc-cplusplus-4.2.0-3.aix6.1.ppc.rpm
2.由于rlwrap需要readline包支持,下载readline包:http://ftp.gnu.org/pub/gnu/readline
安装readline 库文件
1) 解压: gunzip readline-6.1.tar.gz
2) 解包: tar -xvf readline-6.1.tar
3) 安装: cd readline-6.1
./configure ; make ; make install
4) 安装完毕后,readline的库文件,安装在/usr/local/lib 目录下
5) 将相关库文件拷贝到/lib 和 /usr/lib 下
#./configure
#make
#make install
注意需要手工建立到/lib目录下的链接:
# ln -s /usr/local/lib/libreadline.a /lib/libreadline.a
# ln -s /usr/local/lib/libhistory.a /lib/libhistory.a
2.下载rlwrap包:http://utopia.knoware.nl/~hlub/uck/rlwrap
下载 rlwrap-0.37.tar.gz
1) 解压 gunzip rlwrap-0.37.tar.gz
2) 解包:tar -xvf rlwrap-0.37.tar
3) 安装: cd rlwrap-0.37
./configure ; make ; make check ; make install
#./configure
#make
#make install
在/home/oracle/.profile 下建立别名:
alias sqlplus=‘rlwrap sqlplus’
alias rman=‘rlwrap rman’