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: simple ? question

Re: simple ? question

From: Stephane Faroult <sfaroult_at_oriole.com>
Date: Thu, 24 Oct 2002 14:54:19 -0800
Message-ID: <F001.004F33E4.20021024145419@fatcity.com>


Joan Hsieh wrote:
>
> Hi Listers,
>
> I am trying to find a way to know the schema name. Say, if I logged in
> as jjin01_at_ngd. When I run a program, how can I get the schema name
> which should be "ngd"? If I logged in as bkrasnof_at_pr, in this case, the
> schema name will be "pr".
>
> Thanks in advance,
>
> Joan

Joan,

  Beware of vocabulary: what is usually called the 'schema name' is the name of the Oracle account which owns the tables.

   select global_name from global_name;

will return the name of the database. But beware that the name of the database has no link to your @ngd which is just your tns alias (locally defined very often). Most people give as tns alias the name of the SID which is in turn the name of the database, but this is just a common sense rule - nothing mandatory here. It's usually pretty clean on Unix, but under NT a lot of databases have 'ORCL' has their SID, are of course referred to under different names in TNSNAMES.ora and _may_ not have a significant global name (can be changed with 'alter database').

Great opportunity to set up company standards.

-- 
Regards,

Stephane Faroult
Oriole Software
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stephane Faroult
  INET: sfaroult_at_oriole.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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).
Received on Thu Oct 24 2002 - 17:54:19 CDT

Original text of this message

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