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

Home -> Community -> Usenet -> c.d.o.server -> Re: How can I find out which database i'm currently in?

Re: How can I find out which database i'm currently in?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sun, 14 Apr 2002 17:24:40 +0200
Message-ID: <ko7jbugv88orr6eeros2qg90g6v7b967dv@4ax.com>


On Sun, 14 Apr 2002 15:52:08 +0400, Ganesh Raja <ganesh_at_gtfs-gulf.com> wrote:

><html>
><head>
></head>
><body>
><tt>The Glogin.sql file is found at $ORACLE_HOME/sqlplus/admin<br>
><br>
>The Below Select (Courtesy Thomas Kyte will help you.)<br>
><br>
><br>
>select decode(instr(lower(user),'\'),0,lower(user),substr(lower(user),instr(lower(user),'\')+1))
>|| '@' ||<br>
>decode(global_name, 'ORACLE8.WORLD', '8.0', 'ORA8I.WORLD',<br>
>'8i', global_name ) global_name from global_name<br>
><br>
>I have modified it for removing the \ from the username in a NT Authenticated
>account.<br>
><br>
>Hope this helps.<br>
><br>
><br>
><br>
>Md Irfan wrote:<br>
></tt>
><blockquote type="cite" cite="mid:c42168e7.0204140225.401347ca_at_posting.google.com">
> <pre wrap=""><tt>"Glen A Stromquist" <a class="moz-txt-link-rfc2396E" href="mailto:gstrom_at_nosppamtelusplanet.net">&lt;gstrom_at_nosppamtelusplanet.net&gt;</a> wrote in message news:<a class="moz-txt-link-rfc2396E" href="mailto:q4Yt8.10421$6G4.218921_at_news1.telusplanet.net">&lt;q4Yt8.10421$6G4.218921_at_news1.telusplanet.net&gt;</a>...<br></tt></pre>
> <blockquote type="cite">
> <pre wrap=""><tt>select name from v$database<br><br>better yet, configure your sqlplus prompt to show which db you are in by<br>editing your glogin.sql script, you can even have it show who you are logged<br>in as. A google search will bring you lots of possibilities here<br></tt></pre>
> </blockquote>
> <pre wrap=""><!----><tt><br>Hi Glen,<br>I am trying to find out since long how to configure this glogin.sql<br>file.<br>I would like to my database name,user name,database version to display<br>in my sql prompt. Like<br><br>db_name$user_at_db_version<br><br>Thanks for the help.<br><br>Regards.<br>Irfan<br></tt></pre>
> <blockquote type="cite">
> <pre wrap=""><tt>hth<br><br><br>"Max Adams" <a class="moz-txt-link-rfc2396E" href="mailto:RubberDucky703_at_hotmail.com">&lt;RubberDucky703_at_hotmail.com&gt;</a> wrote in message<br><a class="moz-txt-link-freetext" href="news:a99cfc$1e942$1_at_ID-116287.news.dfncis.de">news:a99cfc$1e942$1_at_ID-116287.news.dfncis.de</a>...<br></tt></pre>
> <blockquote type="cite">
> <pre wrap=""><tt>How can I find out which database i'm currently in?<br><br>I'm logged into Oracle via the SQL*Plus command line utility using Oracle<br></tt></pre>
> </blockquote>
> <pre wrap=""><tt> 8i<br></tt></pre>
> <blockquote type="cite">
> <pre wrap=""><tt>Enterprise Edition (8.1.7)<br><br>Is there a command which will tell me which database i am logged into?<br><br>--<br>Thanks lots<br><br><br></tt></pre>
> </blockquote>
> </blockquote>
> </blockquote>
> <tt><br>
> </tt>
> <pre class="moz-signature" cols="$mailwrapcol"><tt>--
>===================================
>[Additions and Corrections Welcome]
>Regards,
>Ganesh R
>===================================</tt></pre>
> <tt><br>
> </tt>
> </body>
> </html>

Please do not post in HTML here, many newsreaders can't cope with it.

Regards

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Sun Apr 14 2002 - 10:24:40 CDT

Original text of this message

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