Get the App
SLTechnology News&Howtos  ›  Database  › 

Quick implementation of command recording and deletion keys in oracle, and quick configuration using scripts

Shulou Source: shulou.com Published: 2022-06-01 14:44:39 11月05日 Update

Environment: centos6

One: command record

1. Install readline-devel using yum

Yum install readline-devel

two。 Source code compilation and installation of rlwrap

# wget http://utopia.knoware.nl/~hlub/rlwrap/rlwrap-0.37.tar.gz# tar-xf rlwrap-0.37.tar.gz# cd rlwrap-0.37/#. / configure# make & & make install

3. Set the system alias of sqlplus: # vim / home/oracle/.bash_profile add: alias sqlplus='rlwrap sqlplus'alias rman='rlwrap rman' to the header or tail

Two: delete key

Under sqlplus, use Backspace to delete characters, use the stty command to redefine ^ H, you can execute stty erase ^ H before using sqlplus, or you can put this sentence in the oracle user's .bash_profile file.

Three: quick configuration of scripts

# / bin/bash

# description:quick configure the oracle del and history command record

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin

Export PATH

# the centos6 has already installed the readline,so we needn't to install the readline again

# yum install readline

# use the yum to install readline-devel

Yum install readline-devel

# use the tar file to install rlwrap

Cd / usr/local/src

Wget http://utopia.knoware.nl/~hlub/rlwrap/rlwrap-0.37.tar.gztar-xf rlwrap-0.37.tar.gzcd rlwrap-0.37/./configuremake & & make install

# configure the .bash _ profile

Cat > > / home/oracle/.bash_profile

Tags: Commands scripts configurations aliases headers characters trailers files source code environment users systems URLs references compilation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL vpn Microsoft Shulou Tech Info Xiaomi