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: SID enumeration help

Re: SID enumeration help

From: joel garry <joel-garry_at_home.com>
Date: 13 Nov 2006 13:47:13 -0800
Message-ID: <1163454433.916885.110480@m73g2000cwd.googlegroups.com>

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/11
Received on Mon Nov 13 2006 - 15:47:13 CST

Original text of this message

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