Joan Hsieh wrote:
> 
> Hi Listers,
> 
> I am trying to find a way to know the schema name. Say, if I logged in
> as jjin01@ngd.  When I run a program, how can I get the schema name
> which should be "ngd"? If I logged in as bkrasnof@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: [EMAIL PROTECTED]

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: [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