Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Getting current instance name with a select ?

Re: Getting current instance name with a select ?

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Thu, 19 Sep 2002 15:11:12 GMT
Message-ID: <3D89E90C.EEFFB67D@exesolutions.com>


Christian BIERO wrote:

> Hello,
>
> Is there a way to get the currently connected instance, using a select ?
>
> Something like : SELECT USER FROM DUAL;
>
> V_$ACTIVE_INSTANCES is empty.
> There's the table V$INSTANCE. I got the good information in INSTANCE_NAME
> but could this table have several records ?
>
> Any help would be appreciated.
>
> Thanks
>
> Christian

If, by chance you are misusing the term instance and really mean database you can use:

col db format a30

SELECT sys_context('USERENV', 'DB_NAME') DB FROM dual;

Daniel Morgan Received on Thu Sep 19 2002 - 10:11:12 CDT

Original text of this message

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