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: Any variable that uniquely identify a DB instance?

Re: Any variable that uniquely identify a DB instance?

From: <buckeye714_at_my-deja.com>
Date: Tue, 31 Oct 2000 14:52:47 GMT
Message-ID: <8tmmbr$ovd$1@nnrp1.deja.com>

In article <8tlpni$ebr$1_at_news.seed.net.tw>,   "Ron TJ HUANG" <ron_huang_at_psitech.com.tw> wrote:
> Dear all,
>
> Is there any environment variable in the DB that uniquely identify a
> database instance?
>
> Many thanks.
>
> Ron.
>
>

If you have access to the system tables, you can use :

   SELECT name FROM v$database;

Otherwise, SELECT * FROM global_name;, will give you the global name of the database. I believe this defaults to the sid, but it is modifiable via 'ALTER DATABASE RENAME GLOBAL_NAME TO <new_name>. This means that you might not get the sid from SELECT * FROM GLOBAL_NAME;, but you should be able to determine which database you are in.

HTH,
Patrick

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Oct 31 2000 - 08:52:47 CST

Original text of this message

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