Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: UNIX-like prompt in SQL*PLUS
Thomas.Meyer wrote:
>
> Dear oraculars,
>
> I sometimes get confused when I have several SQL*PLUS sessions open,
> some connected to different instances on one host, some connected to a
> specific SQL*NET service.
>
> I would like to have the database/service that I'm connected to displayed in the SQL*PLUS prompt, like having the UNIX host name displayed in, say, the ksh prompt.
>
> Do you see a way of bringing the output of "select * from global_name" into the SQL*PROMPT, ideally whenever I do a new "connect"?
>
> When answering, please do a "CC" to Thomas.Meyer_at_dla-marbach.de
>
> Regards,
>
> --
>
> Thomas Meyer, EDV-Systemadministrator
> email: Thomas.Meyer_at_dla-marbach.de
> smail: Deutsches Literaturarchiv Marbach
> Schillerhoehe 8-10
> D-71672 Marbach
> Telefon: +49-7144-848-141
> Fax: ...-387
> WWW: http://www.dla-marbach.de
unix> more $ORACLE_HOME/sqlplus/admin/glogin.sql
rem
rem $Header: glogin.sql 3010108.1 92/12/03 00:34:38 pkonopka
Generic<base> $ Cop
yr (c) 1992 Oracle
rem
rem
rem $Header: glogin.sql,v 1.4 92/10/23 09:44:11 fshapoor Exp $ src60
sqlplus sqlplus/admin glogin.sql 0 Copyr (c) 1988 Oracle Corporation
rem
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
column ROWLABEL format A15
column LINE/COL format A8
column ERROR format A65 WORD_WRAPPED
set pagesize 24
column value new_value _DB_NAME;
set term off
select value from v$parameter where upper(name) = 'DB_NAME';
set SQLPROMPT '&_DB_NAME._SQL> '
set term on
Received on Fri Sep 26 1997 - 00:00:00 CDT