Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SID enumeration help
Steve Howard wrote:
> schw wrote:
> > could you please then provide solutions for unix and winsows
> > seperately?
> >
> > cheers
> > paw
> >
>
> You can use something similar to what is below for *nix...
>
> sids=`cat /etc/oratab | grep -v "#" | grep -v '*' | cut -f1 -d: | sort`
> PS3="Please select an ORACLE environment from the list above: "
> select sid in $sids; do
> export ORACLE_SID="$sid"
> export ORACLE_HOME=`grep "$sid": /etc/oratab | cut -f2 -d:`
> export PATH=$PATH:$ORACLE_HOME/bin
> export PS1=`uname -n`':$LOGNAME:$ORACLE_SID:$PWD>'
> break
> done
>
> You could also invoke oraenv within the loop rather than hardcoding
> your own environment script. I'll leave that as an exercise.
>
Another exercise is how to deal with sites that don't use oratab "properly." I've come across machines where nothing running has anything to do with the obsolete SID's in the oratab, or worse, wrong ORACLE_HOMEs.
Schw, please tell us what you really are intending to accomplish. Spider? Hack? Generalized installation routine? Reinventing the grid?
jg
-- @home.com is bogus. http://top500.org/lists/2006/11Received on Mon Nov 13 2006 - 15:47:13 CST