Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Instance Name in Sql Prompt
Thanks to
Kevin and all that reply.
<SPAN
class=817291220-25102001>
I noticed
when doing a connect inside a session.
<SPAN
class=817291220-25102001>
This will
help.
Ramon E.
Estevez
<A
href="">com.banilejas_at_codetel.net.do
Dominican Republic
809-565-3121
<FONT face=Tahoma
size=2>-----Mensaje original-----De: root_at_fatcity.com
[mailto:root_at_fatcity.com]En nombre de Kevin LangeEnviado el:
Thursday, 25 October, 2001 11:10 AMPara: Multiple recipients of
list ORACLE-LAsunto: RE: Instance Name in Sql
Prompt
<FONT color=#0000ff face=Arial
size=2>Ramon;
<FONT color=#0000ff face=Arial
size=2> In your startup directory on SQL Plus, you can automatically run
a script that will setup the environment like you want it. Its called
LOGIN.SQL.
<FONT color=#0000ff face=Arial
size=2>
Here
is a copy of mine:
<FONT color=#0000ff face=Arial
size=2>
set
termout onset pagesize 0set echo offset feedback offset
sqlprompt ''spool c:\temp.sqlselect 'set sqlprompt '''||name||' >
'';' from v$database;spool off_at_c:\temp.sqlset pagesize 35set
feedback onset termout off
What
this does is to take the name of the database from v$database and create a
temporary SQL file, then runs it. This will set my prompt to
<FONT color=#0000ff face=Arial
size=2>
<FONT color=#0000ff face=Arial
size=2>INSTANCE_NAME >
<FONT color=#0000ff face=Arial
size=2>
<FONT color=#0000ff face=Arial
size=2>where INSTANCE_NAME is the name of the database.
<FONT color=#0000ff face=Arial
size=2>
For
example, if I log onto DEV then the SQLPROMPT will be
<FONT color=#0000ff face=Arial
size=2>
DEV
>
<FONT color=#0000ff face=Arial
size=2>
Hope
you can use it.
<FONT color=#0000ff face=Arial
size=2>
<FONT color=#0000ff face=Arial
size=2>Kevin
<FONT color=#0000ff face=Arial
size=2>
p.s.
... Remember that this only works for the initialization of SQL
Plus. If you do a connect inside of your session then the prompt will
not change.
<FONT face=Tahoma
size=2>-----Original Message-----From: Ramon Estevez
[mailto:com.banilejas_at_codetel.net.do]Sent: Thursday, October 25,
2001 9:35 AMTo: Multiple recipients of list
ORACLE-LSubject: Instance Name in Sql Prompt
Hi
Friends,
<SPAN
class=578542714-25102001>
Excuse me for this
dumb question, how do I display the instance name in
the
sql prompt.
Have 3 DB and would like to know to which one I am
connected.
<SPAN
class=578542714-25102001>
I mean something like
that.
<SPAN
class=578542714-25102001>
DBA1
>
DBA2
>
DB01
>
<SPAN
class=578542714-25102001>
<SPAN
class=578542714-25102001>Regards,
<SPAN
class=578542714-25102001>
Ramon E.
Estevez
<A
href="">com.banilejas_at_codetel.net.do
Dominican Republic
809-565-3121
Received on Thu Oct 25 2001 - 14:08:11 CDT