Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Instance Name in Sql Prompt
There is a way of changing the prompt when doing a "connect", however it's done by running a script called connect.
So instead of the usual:
SQL> connect <user>/<pass>@<sid>
You would do:
SQL> @connect <user>/<pass>@<sid>
Try this URL:
http://asktom.oracle.com/pls/ask/f?p=4950:8:214627::NO::F4950_P8_DISPLAYID,F
4950_P8_CRITERIA:928829365838,%7Bsqlprompt%7D
<http://asktom.oracle.com/pls/ask/f?p=4950:8:214627::NO::F4950_P8_DISPLAYID,
F4950_P8_CRITERIA:928829365838,%7Bsqlprompt%7D>
Cheers,
Kev.
"hit any user to continue"
Kevin Thomas
Technical Analyst
Deregulation Services
Calanais Ltd.
(2nd Floor East - Weirs Building)
Tel: 0141 568 2377
Fax: 0141 568 2366
http://www.calanais.com <http://www.calanais.com/>
-----Original Message-----
Sent: 25 October 2001 21:15
To: Multiple recipients of list ORACLE-L
Thanks to Kevin and all that reply.
I noticed when doing a connect inside a session.
This will help.
Ramon E. Estevez
com.banilejas_at_codetel.net.do <mailto:com.banilejas_at_codetel.net.do>
Dominican Republic
809-565-3121
-----Mensaje original-----
De: root_at_fatcity.com [mailto:root_at_fatcity.com]En nombre de Kevin Lange
Enviado el: Thursday, 25 October, 2001 11:10 AM
Para: Multiple recipients of list ORACLE-L
Asunto: RE: Instance Name in Sql Prompt
Ramon;
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.
Here is a copy of mine:
set termout on
set pagesize 0
set echo off
set feedback off
set sqlprompt ''
spool c:\temp.sql
select 'set sqlprompt '''||name||' > '';' from v$database;
spool off
@c:\temp.sql
set pagesize 35
set feedback on
set 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
INSTANCE_NAME > where INSTANCE_NAME is the name of the database.
For example, if I log onto DEV then the SQLPROMPT will be
DEV > Hope you can use it.
Kevin
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.
-----Original Message-----
Sent: Thursday, October 25, 2001 9:35 AM
To: Multiple recipients of list ORACLE-L
Hi Friends,
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.
I mean something like that.
DBA1 > DBA2 > DB01 >
Regards,
Ramon E. Estevez
com.banilejas_at_codetel.net.do <mailto:com.banilejas_at_codetel.net.do>
Dominican Republic
809-565-3121
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: Kevin.Thomas_at_calanais.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing ListsReceived on Fri Oct 26 2001 - 03:32:51 CDT
--------------------------------------------------------------------
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).
![]() |
![]() |