Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Any variable that uniquely identify a DB instance?
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