How to set cursor movement in oracle SQL

While you are working on SQL*Plus and RMAN on Linux environment and you did some mistake and you want to edit your query it won’t work by default. There is way to configure it.

The rlwrap (readline wrapper) utility provides a command history and editing of keyboard input for any other command. This is a really handy addition to SQL*Plus and RMAN on Linux. Here we are going to guide you how to install rlwrap and set it up for SQL*Plus and RMAN.


For installation you need to configure the EPEL yum repository or download manually and install it.

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

For Oracle Linux you can use below command.


[root@dbatrainings ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

OR

Download from http://yum.oracle.com/repo/OracleLinux/OL8/developer/EPEL/x86_64/index.html

Installing rlwrap 7.6, requires python34 local install

[root@dbatrainings ~]# yum install rlwrap


Optional.


Configure aliases in .bash_profile so that rlwrap gets enabled when you start the command

alias sqlplus=”rlwrap sqlplus”

alias dgmgrl=”rlwrap dgmgrl”

alias rman=”rlwrap rman”

alias lsnrctl=”rlwrap lsnrctl”

alias asmcmd=”rlwrap asmcmd”

alias adrci=”rlwrap adrci”

alias impdp=”rlwrap impdp”

alias expdp=”rlwrap expdp”

[oracle@dbatrainings ~]$ . oraenv

ORACLE_SID = [oracle] ? orcl

The Oracle base has been set to /u01/app/oracle

[oracle@dbatrainings ~]$ rlsqlplus / as sysdba

SQL> select name, open_mode from v$database;


NAME OPEN_MODE

--------- --------------------

ORCL READ WRITE

SQL> select name, open_mode from v$database;

Alternate way you can use without bash profile as well.

[oracle@dbatrainings ~]$ alias rlsqlplus='rlwrap sqlplus'

[oracle@dbatrainings ~]$ rlsqlplus / as sysdba

SQL> select name, open_mode from v$database;


NAME OPEN_MODE

--------- --------------------

ORCL READ WRITE

SQL> select name, open_mode from v$database;


If you like and working for you you can share with others.


41 views0 comments

Recent Posts

See All

How to resolve Backspace key issue in sqlplus.

Backspace key does not work in sqlplus. It's not a issue form Oracle. This is a terminal type issue. echo $TERM stty -a and see if you have done anything special with the backspace key. I hope it’s wo

ADDRESS :

701, Linden, Rosalie Complex Khadakpada, Kalyan (W) Mumbai, Maharashtra 421301)

CONTACT US :

LOCATION :

QUICK LINKS :

SUBSCRIBE HERE :

Don’t Miss a Lecture. Subscribe Today. 

+919322846017  &   +919867493019

EMAIL: 

telegram-512.png

© 2019 DBA Trainings. Proudly Managed By Pearl Organisation

  • Grey LinkedIn Icon
  • Grey YouTube Icon
  • Grey Twitter Icon
  • Grey Facebook Icon