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 184.108.40.206.0 Production on Fri Jul 7 10:41:18 2017
SQL> !cat glogin.sql
set sqlprompt “_user’@’_connect_identifier > ”
SET PAGESIZE 999
SET LINESIZE 132
SET SERVEROUTPUT ON SIZE UNLIMITED FORMAT WRAPPED
COLUMN segment_name FORMAT A36 WORD_WRAP
COLUMN object_name FORMAT A36 WORD_WRAP
Of course you could now use SQLcl – which comes with SQLDeveloper 4.2 and higher – google Jeff Smith – he is the Oracle Product Manager / Evangelist for SQLDeveloper of which SQLcl falls under. SQLcl is now production and hopefully eventually replace the aging sqlplus interface widely. Right now, it’s feature far surpass sqlplus, but it’s adoption will take time.
Part of the reason for the slow adoption, is SQLcl not automatically installed yet, I do not believe on instance/DB creation, hope fully this will change soon (written 07/2017).