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
In Unix add this to your .profile file:
PS1="\$LOGNAME@\$ORACLE_SID:\> " looks like this:
oracle_at_testsid:>
-----Original Message-----
From: Scott Canaan [mailto:srcdco_at_ritvax.isc.rit.edu]
Sent: Thursday, July 06, 2000 4:46 PM
To: Multiple recipients of list ORACLE-L
Subject: Re: Making database name part of SQL prompt in sqlplus
Put this in your glogin file:
set feedback off
set verify off
set echo off
column "value" new_value db_name noprint
column "user" new_value you_are noprint
select
substr(global_name,1,decode(instr(global_name,'.'),null,length(global_name),
instr(global_name,'.') - 1)) "value", user "user"
from sys.global_name;
set sqlprompt '&you_are in &db_name.>'
set feedback on
Jay Weinshenker wrote:
> 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
>
> --
> Author: Jay Weinshenker
> INET: jweinshe_at_concentric.net
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
-- Scott Canaan (srcdco_at_rit.edu) "Life is like a sewer, what you get out of it depends on what you put into it" - Tom Lehrer -- Author: Scott Canaan INET: srcdco_at_ritvax.isc.rit.edu Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You mayReceived on Fri Jul 07 2000 - 07:27:26 CDT