Customizing your SQL* Plus environment with your preferences is easy enough on startup.

Customizing your SQLPlus environment with your preferences is easy enough on startup.
There are two files:
First, sqlplus searches for the file $ORACLE_HOME/sqlplus/admin/glogin.sql, if found,
the script executes any commands it contains.
This “global” login script applies to all users who execute SQL* Plus from that Oracle home, no matter which directory they start sqlplus from.
Then if login.sql exists in the current directory, it runs the file login.sql.
BTW, Windows stores ORACLE_HOME in the registry – no environment variable.

[oracle@o68-cdb admin]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Fri Jul 7 10:41:18 2017
SQL> !cat glogin.sql
set sqlprompt "_user'@'_connect_identifier > "
SET PAGESIZE 999
SET LINESIZE 200
SET SERVEROUTPUT ON SIZE UNLIMITED FORMAT WRAPPED
DEFINE _EDITOR=vi
COLUMN segment_name FORMAT A36 WORD_WRAP
COLUMN object_name FORMAT A60 WORD_WRAP
COLUMN name FORMAT A36 WORD_WRAP
COLUMN value FORMAT A60 WORD_WRAP

For ease of use I put a copy of glogin.sql on a virtualbox share and copy it in for non-production environments.
For additional LonzoDB recent Oracle related posts.

Leave a Comment

Scroll to Top