location of file is cd $ORACLE_HOME/sqlplus/admin
Oracle glogin.sql file
glogin file ......
set verify off termout off head off feed off
col add new_value welcome
select UTL_INADDR.GET_HOST_NAME||':'||UTL_INADDR.GET_HOST_ADDRESS "add" from dual ;
column global_name new_value gname
set termout off
select UTL_INADDR.GET_HOST_NAME||'@'||lower(SYS_CONTEXT('USERENV','CURRENT_USER'))||'-Sql>' global_name from dual ;
set sqlprompt 'gname'
set verify on termout on head on feed on
prompt ************************************
prompt WELCOME TO &&welcome
prompt ************************************
prompt
set echo off serveroutput on size 100000 line 100 trims on
==============================================================================================
or
cat glogin.sql
--
-- Copyright (c) 1988, 2005, Oracle. All Rights Reserved.
--
-- NAME
-- glogin.sql
--
-- DESCRIPTION
-- SQL*Plus global login "site profile" file
--
-- Add any SQL*Plus commands here that are to be executed when a
-- user starts SQL*Plus, or uses the SQL*Plus CONNECT command.
--
-- USAGE
-- This script is automatically run
--
set termout off
set long 5000
set pagesize 9999 linesize 180 longchunksize 180 arraysize 100 num 10
define gname=idle
column global_name new_value gname
--select lower(user) || '@' || sys_context('USERENV','INSTANCE_NAME') global_name from dual;
select lower(sys_context('USERENV','DATABASE_ROLE'))||':'||lower(user) || '@' || sys_context('USERENV','INSTANCE_NAME') global_name from dual;
select lower(sys_context('USERENV','DATABASE_ROLE'))||':'||lower(user) || '@' || sys_context('USERENV','DB_UNIQUE_NAME') || '-' ||sys_context('USERENV','INSTANCE_NAME') global_name from dual;
set sqlprompt '&gname sqlplus> '
-- host title sqlplus connected to &gname
alter session set nls_date_format='dd-mm-yy hh24:mi';
set tab off
set termout on
===========================
Output ..
primary:sys@rac-rac2 sqlplus>