RAJESHKUMAR G said...Hi Tim,
Simple and superb...very useful for me in testing environment.
David D. said...What is meant by: "
it's best to leave the sqlplus and rman commands clean and alias using a different name, just in case
Can you give an example of this "alias"? Sorry I am fairly new to Linux.
David D. said...Nevermind, I think I get it now.
rnm1978 said...Equivalent utility on HP-UX is "ied"
Uwe Küchler said...In case someone gets here by googling: When "./configure" throws an error "You need the GNU readline library", it actually means the readline-devel package. Install it e.g. with "yum install readline-devel", then run "./configure" again.
Jamal said...I usually make a separate custom environment variable script where I define those handy aliases. Hope you understand it's bit annoying when working on multiple terminal and when have to write sqlplus/ as sysdba or rman target/ or even oraenv
You should work the way you want to work. :)
Navi Charlotte said...Best trick ever, Thank you so much!.
I was dismayed to see the lack of these features in the sqlplus client, but thanks heavens for rlwrap!
I am an Arch linux user and fortunately they have rlwrap in the official repos. :D
I'm glad it helped. :) You should also consider using SQLcl from Oracle as it has lots of cool features, including history. It's from folks that built SQL Developer.
Hannes said...rlwrap can do more than just understand cursor keys. It is also capable of keyword expansion, which is quite convenient, If you teach it i.e. all the DBA_* views. I've done that and put it on my website (if somebody is interested: http://www.linuxification.at/rlwrap_ext.html.en) No, that's not commercial - just in case. I also supply a script sql+ taking the burden of writing all those parameters.
Steffen said...Hi Tim,
you wrote - "You should also consider using SQLcl from Oracle as it has lots of cool features, including history."
Does it means, that there is no more need in future for extra installation of "rlwrap" - because SQLcl (under LINUX) is automatically able to use the arrow keys like in WINDOWS?
Best regards Steffen
Yes. SQLcl can do that. :)
Jeff Moss said...Is it me or is that a typo at the start...
At the start you download the epel repo...you say to use this:
rpm -Uvh epel-release-6-8.noarch.rpm
but that file isn't the file you downloaded...this works:
rpm -Uvh epel-release-latest-6.noarch.rpm
You are correct and I've corrected the text. Back in the day they used to release versioned install packages. Now they've switched to the "latest" approach, which is better. I had corrected the download (wget), but not the installation. :)
Rajan said...Awesome ... the pain of typing or copying again and again and again is GONE!! Thanks a lot!!
Patrick Jolliffe said...Hey Tim, Thanks I always refer to this page when setting this up, however I tend to combine the two commands and do:
#rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
# rpm -Uvh epel-release-latest-6.noarch.rpm
(although I'm sure there's a reason you do it separately!)
Yes. I do too. Not really sure why I wrote it this way. Maybe that was one the EPEL setup page when I first wrote it? I've altered it now. :)
Sergiy Stegniy said...Perhaps more conveniently in practice still to use in bash profile:
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
but in scripts for reliability need use a determined version of sqlplus: absolute path or "$ORACLE_HOME/bin/sqlplus" or something like this.
I think it's better to have an environment setup file you source from all your scripts. That way your environment is always consistent, regardless of how the script is called. I tend to use "/home/oracle/scripts/setEnv.sh", which is sourced from all scripts and the "~/.bash_profile". Each to their own. :)
DO NOT ask technical questions here! They will be deleted!
These comments should relate to the contents of a specific article. Constructive criticism is good. Advertising and offensive comments are bad and will be deleted!
If you post personal information (name, email address etc.) you are agreeing to them being stored and displayed. Feel free to remain anonymous.