Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle sqlplus Settin

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. 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 sqlplus environment variable

Sqlplus automatically runs two scripts when it starts: glogin.sql and login.sql.

The order of execution is

1. The default is to find the glogin.sql file under the $ORACLE_HOME/sqlplus/admin path.

two。 The default is to find the login.sql file under the current path, and execute 3 if the corresponding file is not found.

3. Determine whether to set the SQLPATH environment variable. If the variable is set, it will be searched and executed under the corresponding path. If it is not found, the search will stop.

You can add some common settings to the login.sql file to make it easier to use SQLPLUS. The following experiments were carried out on ORACLE 11.2.0.1.0

The glogin.sql file exists under the default $ORACLE_HOME/sqlplus/admin path

Set the SQLPATH environment variable export SQLPATH=$ORACLE_HOME/sqlplus/admin:$SQLPATH in the profile file of the current user

Add our own login.sql file to the default path. The following configuration is commonly used.

Vim $ORACLE_HOME/sqlplus/admin/glogin.sql

-- the SQLPLUS default editor is set to videfine _ editor=vim-- to open DBMA_OUTPUT by default, so it is not necessary to enter this command each time, while setting the default buffer pool as large as possible set serveroutput on size 1000000k. When spooling output text, the space at both ends of the text line is removed, and the line width is variable, if set to off (default setting) The text line width of the spooled output is equal to the set linesizeset trimspool on-- setting, the default number of bytes set long 5000 displayed when selecting LONG and CLOB columns-setting the text width to 200character set linesize 200--set wrap on--, setting the length of the number type field to 16set numwidth 16-setting how often SQLPLUS prints the title Set this parameter larger so that the title set pagesize 9999 SQLPLUS per page is displayed only once-set AUTOTRACE to explain the default width of the plan output, generally 80 is enough to put down the entire plan column plan_plus_exp format A80 Murray-set the SQLPLUS prompt Display format: 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 termout on

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report