How to improve 2-2 after oracle installation how to flip through history commands like the Linux command line
How can oracle flip through history commands like the Linux command line?
If you enter a piece of code or sql in oracle, you will find a syntax error after execution, or you may want to view the previously entered command.
Download rpm package rlwrap (32-bit and 64-bit rpm packages are provided in the attachment)
Http://rpmfind.net/linux/rpm2html/search.php?query=rlwrap
Install rlwrap-0.30-1.el5.i386.rpm
Rpm-ivh rlwrap-0.30-1.el5.i386.rpm
Modify the environment variables of the ORACLE user to generate rlwrap-related command aliases
Su-oracle
Vi .bash _ profile
# add at the end
Alias sql='rlwrap sqlplus'
Alias sqlplus='rlwrap sqlplus'
When alias lsnrctl='rlwrap lsnrctl'## is used to manage the monitoring service, you can turn over the history command with the up and down keys.
Alias rman='rlwrap rman'## for rman can flip the history command up and down
Reload .bash _ profile
Source .bash _ profile
If you have already started oracle or entered the instance, ask exit,shoutdown to restart oracle to enter the instance.