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
[EMAIL PROTECTED]

-----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: [EMAIL PROTECTED]


                                                                                       
                            
                    Walter K                                                           
                            
                    <alden14004@y        To:     Multiple recipients of list ORACLE-L 
<[EMAIL PROTECTED]>       
                    ahoo.com>            cc:                                           
                            
                    Sent by:             Fax to:                                       
                            
                    root@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

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.com/
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Walter K
  INET: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to