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: Steve Howard <stevedhoward_at_gmail.com>
Date: 13 Nov 2006 09:05:59 -0800
Message-ID: <1163437559.674589.327650@m7g2000cwm.googlegroups.com>

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.

HTH, Steve Received on Mon Nov 13 2006 - 11:05:59 CST

Original text of this message

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