First, RLWARP installation
Download: Http://rpmfind.net/linux/rpm2html/search.php?query=rlwrap
Download the corresponding version, such as: rlwrap-0.42-1.el7.x86_64.rpm
RPM-IVH rlwrap-0.42-1.el7.x86_64.rpm
Alias sqlplus= ' Rlwrap sqlplus '
Second, set the Sqlplus environment variable
Sqlplus automatically runs two scripts at startup: Glogin.sql, login.sql two files
The order of execution is
1. Find Glogin.sql file execution under $oracle_home/sqlplus/admin path by default
2. Default in the current path to find the Login.sql file execution, if not found the corresponding file is executed 3
3. Determine if the SQLPATH environment variable is set, if the variable is set to find and execute under the corresponding path, stop finding if it is not found
It is easier to add some common settings to the Login.sql file when using Sqlplus, and the following experiments are performed on Oracle 11.2.0.1.0
Glogin.sql file exists under default $oracle_home/sqlplus/admin path
Setting the SQLPATH environment variable in the current user's profile file export sqlpath= $ORACLE _home/sqlplus/admin: $SQLPATH
Add our own Login.sql file under the default path, the following configuration is common configuration
Vim $ORACLE _home/sqlplus/admin/glogin.sql
--sqlplus default editor set to videfine _editor=vim--opens Dbma_output by default, which makes it unnecessary to set the default buffer pool as large as possible each time you enter this command set serveroutput on size 1000000--The blank space on both ends of the text line when the output text is spooled, and the row width is variable, if set to OFF (the default setting), The text line width of the spool output is equal to the default number of bytes displayed when the linesizeset trimspool on--setting is set to select Long and CLOB columns set long 5000-- Set the displayed text width to 200 characters set linesize 200--set wrap on -- set the number Type field length to 16set numwidth 16 --set Sqlplus how often to print the title, set this parameter larger so that only one title per page is displayed set pagesize 9999-- Set Autotrace to interpret the default width of the plan output, general 80 enough to put down the entire plan column plan_plus_exp format a80--set Sqlplus prompt, Display format for user @ database name column global_name new_value gnameset termout offdefine gname= Idlecolumn global_name new_value gnameselect lower (user) | | ' @'|| substr (Global_name,1,decode (Dot,0,length (global_name), dot-1) global_namefrom (select Global_name,instr (Global_name, '. ') dot from global_name);set sqlprompt ' &gname> ' Set&nbsP;termout on
Oracle sqlplus Settings