$ORACLE_HOME/sqlplus/admin/glogin.sql 这个文件可以设置登录sqlplus后的环境变量

set linesize 200 pagesize 100
col segment_name for a20
col table_name for a30
col instance_number for 999

-- Defaults for editor
define_editor = "vi"
-- set sqlprompt "&_connect_identifier>"

column plan_plus_exp format a80
column global_name new_value gname
set termout off

--select lower(user) || '@' ||
--case when instr(global_name,'.')>1
--then substr(global_name,1,instr(global_name,'.')-1)
--else global_name end
--global_name from global_name;

select lower(user) || '@' ||
case when instr(global_name,'.')>1
then substr(global_name,1,instr(global_name,'.')-1)
else global_name end || '@' || host_name
global_name from global_name, v$instance;

set sqlprompt '&gname> '

set termout on
set time on timing on