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
--=====================_1757839569==_.ALTContent-Type: text/plain; charset="us-ascii"; format=flowed
Here's our glogin.sql which sets the prompt:
rem SQL*Plus global login startup file.
rem
rem Set the SQL prompt to include the database name
rem selected from v$parameter
rem
rem set feedb on echo on
set termout off
column value noprint new_value dbname
select value
from v$parameter
where name = 'db_name'
/
set sqlprompt "&dbname:SQL>"
column value print
rem
rem Issue a commit to clear transaction buffer in case
rem the user wants to do a 'set transaction ...'
rem
commit
/
def _editor=vi
set newpage 0
set pagesize 23
set numwidth 7
set pause on pause '[4mPress enter to continue or ^C to stop[5m...[m'
rem
rem Invoke users '.sqlrc' file if it exists
rem
@$HOME/.sqlrc
set termout on
At 12:26 PM 7/6/00 , you 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).
--=====================_1757839569==_.ALTContent-Type: text/html; charset="us-ascii"
<html>
<font face="Courier New, Courier">Here's our glogin.sql which sets the
prompt: <br>
<br>
rem SQL*Plus global login startup file.<br>
rem<br>
rem Set the SQL prompt to include the database name <br>
rem selected from v$parameter<br>
rem <br>
rem set feedb on echo on<br>
set termout off<br>
column value noprint new_value dbname<br>
select value<br>
from v$parameter<br>
where name = 'db_name'<br>
/<br>
set sqlprompt "&dbname:SQL>"<br>
column value print<br>
rem<br>
rem Issue a commit to clear transaction buffer in case <br>
rem the user wants to do a 'set transaction ...'<br>
rem<br>
commit<br>
/<br>
<br>
def _editor=vi<br>
set newpage 0<br>
set pagesize 23<br>
set numwidth 7<br>
set pause on pause '[4mPress enter to continue or ^C to
stop[5m...[m'<br>
rem<br>
rem Invoke users '.sqlrc' file if it exists<br>
rem<br>
@$HOME/.sqlrc<br>
set termout on<br>
<br> <br> <br> </font>At 12:26 PM 7/6/00 , you wrote:<br> <blockquote type=cite cite>Anyone know how to do it?<br> <br>
--------------------------------------------------------------------<br>To REMOVE yourself from this mailing list, send an E-Mail message<br> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in<br> the message BODY, include a line containing: UNSUB ORACLE-L<br> (or the name of mailing list you want to be removed from). You may<br>