Title: RE: how can I see which database I am logged into without

My point was that you can see different names by using different queries.  But, you and Mike brought up a good point- I need to use the "alter database rename global_name to XXX" after cloning databases to avoid any such confusion.  Thanks for that tip.


Best regards,

David B. Wagoner
Database Administrator
Arsenal Digital Solutions


-----Original Message-----
From: Wolfgang Breitling [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 11, 2003 3:44 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: how can I see which database I am logged into without


What is your point? Mike Hately's statement is still correct. It returns
the global_name which should be, but not necessarily IS, the same as
db_name since it can be set to any arbitrary value. Of course, if you are
using replication you better set it to the correct value or it will not work:

stats.scott > alter database rename global_name to something.world;

Database altered.

stats.scott> select ora_database_name, sys_context('USERENV','DB_NAME')
db_name from dual;

ORA_DATABASE_NAME              DB_NAME
------------------------------ --------------------
SOMETHING.WORLD                stats

1 row selected.


At 10:59 AM 9/11/2003 -0800, you wrote:
>/u005/oracle/product/rdbms/admin> ls -l dbmstrig.sql
>-rw-r--r--   1 oracle   dba         8657 Apr 28  2002 dbmstrig.sql
>
>/u005/oracle/product/9.2.0/rdbms/admin> sed -n '76,85p' dbmstrig.sql
>Rem returns the current database name
>create or replace function database_name return varchar2 is
>begin
>return dbms_standard.database_name;
>end;
>/
>grant execute on database_name to public
>/
>create or replace public synonym ora_database_name for database_name
>/
>
>/u005/oracle/product/9.2.0/rdbms/admin>
>
>HTH
>GovindanK
>
>On Thu, 11 Sep 2003 05:39 , Hately, Mike (LogicaCMG)
><[EMAIL PROTECTED]> sent:
>
> >Hi,
> >this statement returns the GLOBAL_NAME value rather than the database name.
> >Admittedly the 2 should usually be the same but often (following a database
> >clone for instance) it is not correctly set.
> >
> >Regards,
> >Mike Hately

Wolfgang Breitling
Oracle7, 8, 8i, 9i OCP DBA
Centrex Consulting Corporation
http://www.centrexcc.com


--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Wolfgang Breitling
  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