Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Database Name ???

RE: Database Name ???

From: Alex Hillman <alex_hillman_at_physia.com>
Date: Mon, 12 Jun 2000 11:04:46 -0400
Message-Id: <10526.108669@fatcity.com>


This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible.

------_=_NextPart_001_01BFD47F.8BF7EFF0
Content-Type: text/plain;

        charset="iso-8859-1"

It will not work if user does not have privilages to select on v$session and v$database.

Alex Hillman

-----Original Message-----
From: Ruth Gramolini [mailto:rgramolini_at_tax.state.vt.us] Sent: Monday, June 12, 2000 10:19 AM
To: Multiple recipients of list ORACLE-L Subject: Re: Database Name ???

Ari Kaplan posted this a couple of weeks ago. You simply put the following lines into the glogin.sql of the users' machines. rem Code to set dbname in logon promt
set heading off
set sqlprompt off
spool make_prompt.sql
SELECT 'set sqlprompt '''|| d.name ||'@' || substr(s.machine,1,decode (instr(s.machine,'.'), 0, length(s.machine), instr(s.machine,'.') - 1)) ||
'-SQL> '''
FROM V$SESSION s, V$DATABASE D
WHERE s.SID=1;
spool off
@make_prompt.sql
set heading on
set feedback on

Then the name of the instance will be identified in the login prompt.

HTH
Ruth B. Gramolini
ORACLE & DB2 DBA
VT Dept. of Taxes
ph# 802.828.5708
fax# 802.828..3754
rgramolini_at_tax.state.vt.us
----- Original Message -----
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> Sent: Monday, June 12, 2000 9:15 AM

>
>
> Dear Experts,
>
> I have three databases in Oracle workgroup server 7.3.
> In the front-end application, I want to display the database name to which
> the connection is available.
> what query will give this ?
>
> Richard
>
>
> --
> Author:
> INET: drichard_at_mtlindia.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).
>

-- 
Author: Ruth Gramolini
  INET: rgramolini_at_tax.state.vt.us

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

------_=_NextPart_001_01BFD47F.8BF7EFF0
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE>RE: Database Name ???</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>It will not work if user does not have privilages to select on v$session and v$database.</FONT>
</P>

<P><FONT SIZE=2>Alex Hillman</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Ruth Gramolini [<A HREF="mailto:rgramolini_at_tax.state.vt.us">mailto:rgramolini_at_tax.state.vt.us</A>]</FONT>
<BR><FONT SIZE=2>Sent: Monday, June 12, 2000 10:19 AM</FONT>
<BR><FONT SIZE=2>To: Multiple recipients of list ORACLE-L</FONT>
<BR><FONT SIZE=2>Subject: Re: Database Name ???</FONT>
</P>
<BR>

<P><FONT SIZE=2>Ari Kaplan posted this a couple of weeks ago. You simply put the following</FONT>
<BR><FONT SIZE=2>lines into the glogin.sql of the users' machines.</FONT>
<BR><FONT SIZE=2>rem Code to set dbname in logon promt</FONT>
<BR><FONT SIZE=2>set heading off</FONT>
<BR><FONT SIZE=2>set sqlprompt off</FONT>
<BR><FONT SIZE=2>spool make_prompt.sql</FONT>
<BR><FONT SIZE=2>SELECT 'set sqlprompt '''|| d.name ||'@' ||</FONT>
<BR><FONT SIZE=2>substr(s.machine,1,decode (instr(s.machine,'.'), 0, length(s.machine),</FONT>
<BR><FONT SIZE=2>instr(s.machine,'.') - 1)) ||</FONT>
<BR><FONT SIZE=2>'-SQL&gt; '''</FONT>
<BR><FONT SIZE=2>FROM V$SESSION s, V$DATABASE D</FONT>
<BR><FONT SIZE=2>WHERE s.SID=1;</FONT>
<BR><FONT SIZE=2>spool off</FONT>
<BR><FONT SIZE=2>@make_prompt.sql</FONT>
<BR><FONT SIZE=2>set heading on</FONT>
<BR><FONT SIZE=2>set feedback on</FONT>
</P>

<P><FONT SIZE=2>Then the name of the instance will be identified in the login prompt.</FONT>
</P>

<P><FONT SIZE=2>HTH</FONT>
<BR><FONT SIZE=2>Ruth B. Gramolini</FONT>
<BR><FONT SIZE=2>ORACLE &amp; DB2&nbsp; DBA</FONT>
<BR><FONT SIZE=2>VT Dept. of Taxes</FONT>
<BR><FONT SIZE=2>ph# 802.828.5708</FONT>
<BR><FONT SIZE=2>fax# 802.828..3754</FONT>
<BR><FONT SIZE=2>rgramolini_at_tax.state.vt.us</FONT>
<BR><FONT SIZE=2>----- Original Message -----</FONT>
<BR><FONT SIZE=2>To: Multiple recipients of list ORACLE-L &lt;ORACLE-L_at_fatcity.com&gt;</FONT>
<BR><FONT SIZE=2>Sent: Monday, June 12, 2000 9:15 AM</FONT>
</P>
<BR>

<P><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; Dear Experts,</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; I have&nbsp; three databases in Oracle workgroup server 7.3.</FONT>
<BR><FONT SIZE=2>&gt; In the front-end application, I want to display the database name to which</FONT>
<BR><FONT SIZE=2>&gt; the connection is available.</FONT>
<BR><FONT SIZE=2>&gt; what query will give this ?</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; Richard</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; --</FONT>
<BR><FONT SIZE=2>&gt; Author:</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp; INET: drichard_at_mtlindia.com</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) 538-5051&nbsp; FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=2>&gt; San Diego, California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet access / Mailing Lists</FONT>
<BR><FONT SIZE=2>&gt; --------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>&gt; To REMOVE yourself from this mailing list, send an E-Mail message</FONT>
<BR><FONT SIZE=2>&gt; to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in</FONT>
<BR><FONT SIZE=2>&gt; the message BODY, include a line containing: UNSUB ORACLE-L</FONT>
<BR><FONT SIZE=2>&gt; (or the name of mailing list you want to be removed from).&nbsp; You may</FONT>
<BR><FONT SIZE=2>&gt; also send the HELP command for other information (like subscribing).</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
</P>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Author: Ruth Gramolini</FONT>
<BR><FONT SIZE=2>&nbsp; INET: rgramolini_at_tax.state.vt.us</FONT>
</P>

<P><FONT SIZE=2>Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) 538-5051&nbsp; FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=2>San Diego, California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet access / Mailing Lists</FONT>
<BR><FONT SIZE=2>--------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>To REMOVE yourself from this mailing list, send an E-Mail message</FONT>
<BR><FONT SIZE=2>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in</FONT>
<BR><FONT SIZE=2>the message BODY, include a line containing: UNSUB ORACLE-L</FONT>
<BR><FONT SIZE=2>(or the name of mailing list you want to be removed from).&nbsp; You may</FONT>
Received on Mon Jun 12 2000 - 10:04:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US