Thanks it was great

Roland




"IT - Database (Do Not Use)" <[EMAIL PROTECTED]>@fatcity.com den 
2001-10-25 07:15 PST

S�nd svar till [EMAIL PROTECTED]

S�nt av:  [EMAIL PROTECTED]


Till: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
Kopia:

I got this from someone on the list.  It shows server, instance and username.  Put it 
in your login.sql

set sqlprompt 'SQL> '

column SQLQueryDatabase   new_value SQLPromptDatabase   noprint
column SQLQueryTablespace new_value SQLPromptTablespace noprint
column SQLQueryUsername   new_value SQLPromptUsername   noprint
column SQLQueryHost       new_value SQLPromptHost       noprint

                                /* remove ".WORLD"; append "." just
                                 * in case it is absent
                                 */
select initcap(substr(g.GLOBAL_NAME,
                      1,
                      instr(g.GLOBAL_NAME || '.',
                            '.') - 1)) SQLQueryDatabase,
       u.DEFAULT_TABLESPACE            SQLQueryTablespace,
       u.USERNAME                      SQLQueryUsername
   from GLOBAL_NAME g,
        USER_USERS  u
/

                                /* this defaults the SQLQueryHost variable
                                 * in case we have no privileges on the
                                 * v$session view
                                 */
select '' SQLQueryHost
   from USER_USERS
   where rownum = 1
/

select initCap(decode(s.MACHINE,
                      NULL, '',
                      '', '',
                      s.MACHINE || '/')) SQLQueryHost
   from V$SESSION s
   where upper(s.PROGRAM) like 'ORACLE%.EXE' or  -- uSoft executable
         upper(s.PROGRAM) like 'ORACLE%(PMON)%'  -- Unix ps style
/

--set sqlprompt '[&SQLPromptHost&SQLPromptDatabase:&SQLPromptTablespace]
&SQLPromptUsername> '
set sqlprompt '[&SQLPromptHost&SQLPromptDatabase] &SQLPromptUsername> '

select ''    SQLQueryDatabase,
       ''    SQLQueryHost,
       ''    SQLQueryTablespace,
       'SQL' SQLQueryUsername
   from USER_USERS
/

column SQLQueryDatabase   clear
column SQLQueryHost       clear
column SQLQueryTablespace clear
column SQLQueryUsername   clear

input --
del 1 last

set termout on
set pages 9999
     -----Original Message-----
     From: Ramon Estevez [mailto:[EMAIL PROTECTED]]
     Sent: Thursday, October 25, 2001 8:35 AM
     To: Multiple recipients of list ORACLE-L
     Subject: Instance Name in Sql Prompt

     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
     [EMAIL PROTECTED]
     Dominican Republic
     809-565-3121









--
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).

Reply via email to