solaris下的sqlplus+rlwrap

http://inthirties.com:90/thread-1389-1-1.html


在以前就写过一个文章,介绍在Linux环境下,通过rlwrap,让sqlplu的控制台和linux一样,支持 命令历史的用法。
这样使我们的sqlplus使用起来更方便,就和使用linux没有什么差别。文章见 http://inthirties.com:90/thread-1060-1-1.html

用惯了这样的方式,换到还要一个一个字母的把以前的命令敲出来的话,肯定是不能忍受的,所以在solaris的平台上也找到了readline和 rlwrap的solaris版本,马上装起来吧。

下载地址 http://ivan.kartik.sk/?min=1151704800&max=1154383200 或者是 http://inthirties.com:90/thread-1388-2-1.html

安装步骤

[root@solaris oracle]gunzip readline-5.1-solaris-x86.gz
[root@solaris oracle]gunzip rlwrap-solaris-x86.gz
[root@solaris oracle]ls
readline-5.1-solaris-x86
rlwrap-solaris-x86

先安装readline,

[root@solaris oracle]pkgadd -d readline-5.1-solaris-x86

The following packages are available:
1 readline readline
(x86) 5.1

Select package(s) you wish to process (or ‘all’ to process
all packages). (default: all) [?,??,q]: y
………………
Do you want to install these conflicting files [y,n,?,q] y
## Checking for setuid/setgid programs.

Installing readline as

## Installing part 1 of 1.
/usr/local/include/readline/chardefs.h
/usr/local/include/readline/history.h
/usr/local/include/readline/keymaps.h
/usr/local/include/readline/readline.h
/usr/local/include/readline/rlconf.h
/usr/local/include/readline/rlstdc.h
/usr/local/include/readline/rltypedefs.h
/usr/local/include/readline/tilde.h
/usr/local/lib/libhistory.a
/usr/local/lib/libhistory.so
/usr/local/lib/libhistory.so.5
/usr/local/lib/libreadline.a
/usr/local/lib/libreadline.so
/usr/local/lib/libreadline.so.5
/usr/local/prototype
[ verifying class ]

Installation of was successful.

再安装rlwrap

[root@solaris oracle]pkgadd -d rlwrap-solaris-x86

The following packages are available:
1 rlwrap rlwrap
(x86) 0.26

Select package(s) you wish to process (or ‘all’ to process
all packages). (default: all) [?,??,q]:
…….
Do you want to install these conflicting files [y,n,?,q] y
## Checking for setuid/setgid programs.

Installing rlwrap as

## Installing part 1 of 1.
/usr/local/bin/rlwrap
/usr/local/man/man1/rlwrap.1
/usr/local/share/rlwrap/coqtop
/usr/local/share/rlwrap/ftp
/usr/local/share/rlwrap/testclient
[ verifying class ]

Installation of was successful.

试用一下吧
[oracle@solaris ~]ORACLE_SID=+ASM1
[oracle@solaris ~]rlwrap sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Apr 7 15:40:10 2010

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

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> exit

这里的方向箭头,已经可以使用了,要调出以前使用过的sqlplus命令,一个劲的上箭头就可以了。

修改/etc/profile
加入alais。

alias sqlplus=”rlwrap sqlplus”
alias rman=”rlwrap rman”
alias lsnrctl=”rlwrap lsnrctl”
alias bbed=”rlwrap bbed”

现在一次试一试这些带有自己命令行模式的命令吧。

是不是都和linux一样。支持用上下箭头,回看命令了呀。
  • 提供Oracle管理/故障处理/优化/安装/RAC/备份恢复技术服务,提供专业的Oracle培训和咨询服务。
  • 邮件: [email protected]
  • MSN: [email protected]
  • QQ: [email protected]
  • 电话: 13828706466
  • 技术博客 http://blog.csdn.net/inthirties
  • 个人站点 http://blog.inthirties.com

你可能感兴趣的:(oracle,linux,Solaris,application,database,Class)