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: Ganesh Raja <ganesh_at_gtfs-gulf.com>
Date: Sun, 14 Apr 2002 15:52:08 +0400
Message-ID: <3CB96D68.4020809@gtfs-gulf.com>





The Glogin.sql file is found at $ORACLE_HOME/sqlplus/admin

The Below Select (Courtesy Thomas Kyte will help you.)


select decode(instr(lower(user),'\'),0,lower(user),substr(lower(user),instr(lower(user),'\')+1)) || '@' ||
decode(global_name, 'ORACLE8.WORLD', '8.0', 'ORA8I.WORLD',
'8i', global_name ) global_name from global_name

I have modified it for removing the \ from the username in a NT Authenticated account.

Hope this helps.



Md Irfan wrote:
"Glen A Stromquist" <gstrom@nosppamtelusplanet.net> wrote in message news:<q4Yt8.10421$6G4.218921@news1.telusplanet.net>...
select name from v$database

better yet, configure your sqlplus prompt to show which db you are in by
editing your glogin.sql script, you can even have it show who you are logged
in as. A google search will bring you lots of possibilities here

Hi Glen,
I am trying to find out since long how to configure this glogin.sql
file.
I would like to my database name,user name,database version to display
in my sql prompt. Like

db_name$user@db_version

Thanks for the help.

Regards.
Irfan
hth


"Max Adams" <RubberDucky703@hotmail.com> wrote in message
news:a99cfc$1e942$1@ID-116287.news.dfncis.de...
How can I find out which database i'm currently in?

I'm logged into Oracle via the SQL*Plus command line utility using Oracle
 8i
Enterprise Edition (8.1.7)

Is there a command which will tell me which database i am logged into?

--
Thanks lots



-- 
===================================
[Additions and Corrections Welcome]
Regards,
Ganesh R
===================================

Received on Sun Apr 14 2002 - 06:52:08 CDT

Original text of this message

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