Re: How to identify the 'current' instance

From: John Strange <jstrange_at_imtn.dsccc.com>
Date: 1996/10/16
Message-ID: <542jqk$se6_at_camelot.dsccc.com>#1/1


When sqlplus starts up, it looks for login.sql in the SQLPATH environment variable. Here is what is in mine.

rem /*********************************************************************
rem *
rem *   login.sql - sqlplus start up file
rem *
rem *   next four statements sets the sql prompt = oracle instance.
rem *
rem *********************************************************************/
 

column sid new_value osid noprint
select lower (substr (global_name, 1, (instr (global_name, '.') -1))) sid from global_name ;
set sqlprompt '&osid> '

AMARENDRA B NETTEM (nettama_at_charlie.acc.iit.edu) wrote:

: 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.yes at the oerating system prompt type
: echo $ORACLE_SID
: gives the current instance

TWO_TASK overides ORACLE_SID

--
This posting represents the personal opinions of the author. It is not the
official opinion or policy of the author's employer. Warranty expired when you
opened this article and I will not be responsible for its contents or use.
Received on Wed Oct 16 1996 - 00:00:00 CEST

Original text of this message