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 -> Re: shell script lesson needed regarding oraenv script

Re: shell script lesson needed regarding oraenv script

From: Ed Stevens <nospam_at_noway.nohow>
Date: Fri, 19 Nov 2004 15:35:49 -0600
Message-ID: <kepsp05bmkmd5iddt4o3mp1c0rh29hkurb@4ax.com>


On Thu, 18 Nov 2004 15:53:18 -0600, Ed Stevens <nospam_at_noway.nohow> wrote:

>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.
>
>=== begin transcript ===
>oracle:cat /var/opt/oracle/oratab
>#
><snip a bunch of comment lines
>#
>*:/u01/app/oracle/product/9.2.0:N
>CMDM1240:/u01/app/oracle/product/9.2.0:Y
>CMQM1240:/u01/app/oracle/product/9.2.0:Y
>
>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 ===
>

Dave and Hans -- thanks for the replies. That plus additional study has clarified a lot for me. Now that I've gotten much more familiar with the workings of oraenv I'm wondering about the real value of these vendor supplied functions. Other than eventually calling oraenv, I seem them doing two things. First, they actually list the available SIDs (based on what it finds in oratab) and takes input using the 'select ... in' construct. That's a nice touch because you don't have to remember the name of the sid and, more important, can't fat-finger it.

The second thing the function does over and above oraenv is set the environment for LIB_PATH, LD_LIBRARY_PATH, and LD_LIBRARY_PATH_64. I've never paid much attention to these so am wondering if this is any real value or just over-engineering by the vendor. Received on Fri Nov 19 2004 - 15:35:49 CST

Original text of this message

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