Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Getting current instance name with a select ?
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
![]() |
![]() |