add this to $ORACLE_HOME/sqlplus
— setup a prompt with user name and connect
set sqlprompt "_user'@'_connect_identifier > "
— set the default editor to vi
define _editor=vi
— from that point forward – all users will get the user that they are connected as and the SID / Connect Identifier embedded in their sqlprompt making connecting to many databases safer.
— and if you wanted you could add stuff like:
[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 define _editor=vi
For additional LonzoDB recent Oracle related posts.