top of page

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.


OR

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.





243 views0 comments

Recent Posts

See All

How to Connect MySQL Without Root Password.

Many times, I got the question from my colleague or training participants, how to login MySQL if I forgot the password. I have explained the process in many times to them but thought to write this sce

Step by Step Oracle 21c Installation on Linux

Oracle Database 21c is the first Oracle database release with CDB-only architecture. Oracle 20c was announced only CDB architecture but it was not release for on premises. Only for Cloud. That's why i

bottom of page