Re: How to identify the 'current' instance

From: Fengqing Zhou <zhouf_at_tigger.cs.colorado.edu>
Date: 1996/10/15
Message-ID: <5414nr$lc4$1_at_csnews.cs.colorado.edu>#1/1


In article <slrn565dvj.7qh.roby_at_h2net.net>, Roby Sherman <roby_at_h2net.net> wrote:
>In article <53u9au$i7d_at_gw.PacBell.COM>, j4xprel_at_pbsrv10.isp.pacbell.com wrote:
>>running under hp-ux, after exporting ORACLE_SID=TST, TWO_TASK=DEV and
>>then logging on to sql*plus with 'sqlplus user_id_at_T:host_name:PRD' is
>>there any way to query the correct current instance?
>>
>>thanks in advance.
>>
>
>select global_name from global_name;

It will return database name instead of instance name.

Try:
select INSTANCE from v$database;

to get instance name

Good Luck!

>
>This will report back the global_name of the current database.
>
>--
>--roby_at_h2net.net------------------------------------------------Denver, CO--
>
> A well-used door needs no oil on its hinges.
> A swift-flowing stream does not grow stagnant.
> Neither sound nor thoughts can travel through a vacuum.
> Data rots if not used.
>
> These are great mysteries.
>----------------------------------------------------------------------------
>
>
Received on Tue Oct 15 1996 - 00:00:00 CEST

Original text of this message