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

Home -> Community -> Usenet -> c.d.o.server -> shell script lesson needed regarding oraenv script

shell script lesson needed regarding oraenv script

From: Ed Stevens <nospam_at_noway.nohow>
Date: Thu, 18 Nov 2004 15:53:18 -0600
Message-ID: <5b2qp0d2m4loa4ulhjsidktf5tk24k9lnc@4ax.com>


Platform: Oracle 9.2 on Solaris 9

One group of servers I inherited had the db's built by the installation procedure of a package product. The install was pretty much textbook OFA, and included some useful scripts that I'm studying for the possibility of using them on other setups not related to the product.

In oracle's .profile, they placed a set of functions to select the $ORACLE_SID from a list derived from the oratab file. It actually calls the oraenv script (with ORAENV_ASK=NO) then also sets LD_LIBRARY_PATH and LD_LIBRARY_PATH_64 and some app specific stuff. Rather than accepting free-form input, it presents the list of sids and gets its input using a 'select' statement, forcing you to make a valid choice. A nice touch, I thought.

Since I had never used oraenv, I started studying the code and playing around with it. I'll not quote the oraenv script since everyone has access to it on their systems, but here is some screen output of my expriments.... notice that the value of ORACLE_SID never changes. This is my own command line use of oraenv. When invoked by the function provided by the vendor, all is well with the world.

oracle:echo $ORACLE_SID

< note it is not set at this point >

oracle:echo $ORAENV_ASK
YES oracle:oraenv
ORACLE_SID = [oracle] ?
ORACLE_HOME = [/local/home/oracle] ?

oracle:echo $ORACLE_SID

<still not set!>

oracle:oraenv
ORACLE_SID = [oracle] ? CMDM1240
oracle:echo $ORACLE_SID

<still not set!>

=== end transcript === Received on Thu Nov 18 2004 - 15:53:18 CST

Original text of this message

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