Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Making database name part of SQL prompt in sqlplus
This is my glogin.sql script that will show you the user who login, the
instance which you login and the machine that the instance reside it (does
not work for OPS). For all to work, you will need to logon as someone who
is a DBA or have select any table privilege.
Winnie
rem SQL*Plus Global Login startup file.
rem
rem This is the global login file for SQL*Plus.
rem Add any sqlplus commands here that are to be
rem executed when a user invokes sqlplus
rem Used by Trusted Oracle
column ROWLABEL format A15
rem Used for the SHOW ERRORS command
column LINE/COL format A8
column ERROR format A65 WORD_WRAPPED
rem For backward compatibility
set pagesize 14
rem Defaults for SET AUTOTRACE EXPLAIN report
column id_plus_exp format 990 heading i
column parent_id_plus_exp format 990 heading p
column plan_plus_exp format a60
column object_node_plus_exp format a8
column other_tag_plus_exp format a29
column other_plus_exp format a44
set time on
set serveroutput on size 1000000 format wrapped
column sid2 new_value osid noprint
column usr new_value ousr noprint
column machin new_value omach noprint
set termout off
select user usr from dual;
select machine machin from v$session where program like 'oracle%(PMON)%';
Jay Weinshenker <jweinshe_at_concentric.net> on 07/06/2000 10:55:43 AM
To: ORACLE-L_at_fatcity.com, oracledba_at_quickDOC.co.uk cc: (bcc: Winnie Liu/HQ/ISC)
Subject: Making database name part of SQL prompt in sqlplus
Anyone know how to do it?
I've got a number of users doing SQL*Plus work and they keep making errors as to which instance they are in...
Anyone?
J