Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: SID on sqlplus prompt?
Neat! I knew there was some way of selecting that, but couldn't remember it and also couldn't find them in the FM. Didn't someone complain about the terrible indexes on Oracle manuals? Let me add my voice to that particular clamor.
Diana Duncan
TITAN Technology Partners
One Copley Parkway, Ste 540
Morrisville, NC 27560
VM: 919.466.7337 x 316
F: 919.466.7427
E: Diana_Duncan_at_ttpartners.com
"MacGregor, Ian A." To: Multiple recipients of list ORACLE-L
<ORACLE-L_at_fatcity.com>
<ian_at_SLAC.Sta cc: nford.EDU> Fax to: Sent by: Subject: RE: SID on sqlplus prompt? root_at_fatcity. com 06/09/2001 12:40 PM Please respond to ORACLE-L
If the db_name will do just as well you can use
sys_context('USERENV', 'DB_NAME') to obtain the database name and not
have to grant access to any of the v$ tables. There's also
ora_database_name which is a function that takes no arguments and returns
<db_name>.<domain_name> Both of these can "selected from dual"
Ian MacGregor
Stanford Linear Accelerator Center
ian_at_slac.tanford.edu
-----Original Message-----
Sent: Friday, June 08, 2001 2:30 PM
To: Multiple recipients of list ORACLE-L
How about something like this? Of course, it requires that the user have select access to v$instance -- maybe there's another place to find this. You could do some sort of batch to reference the $ORACLE_SID instead, but the advantage of this is you can put it into glogin.sql or login.sql -- or maybe not. I just tried doing that and it didn't affect anything. Hmm. Oh, well, this may help you...
set heading off
set term off
set feedback off
spool set_sqlprompt.lst
select 'set sqlprompt "' || instance_name || '> "'
from v$instance
/
spool off
@set_sqlprompt.lst
set heading on
set term on
set feedback on
Diana Duncan
TITAN Technology Partners
One Copley Parkway, Ste 540
Morrisville, NC 27560
VM: 919.466.7337 x 316
F: 919.466.7427
E: Diana_Duncan_at_ttpartners.com
Walter K <alden14004_at_y To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> ahoo.com> cc: Sent by: Fax to: root_at_fatcity. Subject: SID on sqlplus prompt? com 06/08/2001 04:35 PM Please respond to ORACLE-L
Hi,
Is there a way to get the SID or database name
displayed in the command prompt of SQL*Plus? Can this
be generated dynamically if I perform a "CONNECT
<user>/<pw>" ?
Thanks!
-w
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Walter K INET: alden14004_at_yahoo.com 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: Diana_Duncan_at_ttpartners.com 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: MacGregor, Ian A. INET: ian_at_SLAC.Stanford.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 may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: Diana_Duncan_at_ttpartners.com 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).Received on Sat Jun 09 2001 - 13:50:09 CDT