| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: shell script lesson needed regarding oraenv script
"Ed Stevens" <nospam_at_noway.nohow> wrote in message
news:5b2qp0d2m4loa4ulhjsidktf5tk24k9lnc_at_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.
>
> === 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 ===
>
>
you need to do . oraenv, without the dot the change isnt permanent.
watch out for copyright on those scripts as well Received on Thu Nov 18 2004 - 15:58:05 CST
![]() |
![]() |