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: Logging In

Re: Logging In

From: Steve Howard <stevedhoward_at_gmail.com>
Date: Fri, 7 Dec 2007 17:44:16 -0800 (PST)
Message-ID: <74f017d1-a0e4-47d5-ac06-c81172566fd7@j44g2000hsj.googlegroups.com>


On Dec 7, 8:04 pm, "ame..._at_iwc.net" <ame..._at_iwc.net> wrote:
> Hi,
>
> When you log into a server you usually get a list of default
> environment variables that look like below. Our oracle account does
> not have a .profile. However, I want to change the default ORACLE_SID
> when a user logs in.
>
> Does anyone know what file I'd modify? I get entries like below when
> I log in as any user:
>
> declare -x ORACLE_BASE="/opt/oracle/product"
> declare -x ORACLE_HOME="/opt/oracle/product/ora10"
> declare -x ORACLE_SID="OR00"
> declare -x PATH="/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/
> X11R6/bin:/home/oracle/bin"
> declare -x PWD="/home/oracle"
> declare -x SHELL="/bin/bash"
> declare -x SHLVL="1"
> declare -x SSH_CLIENT="::ffff:205.234.192.162 41110 22"
> declare -x SSH_CONNECTION="::ffff:205.234.192.162 41110 ::ffff:
> 205.234.192.188 22"
> declare -x SSH_TTY="/dev/pts/3"
> declare -x TERM="xterm"
> declare -x USER="oracle"
>
> Thanks!!!

Try modifying what is below...

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 PS1=`uname -n`':$LOGNAME:$ORACLE_SID:$PWD>'   export PATH=/bin:/usr/bin:/usr/local/bin:$ORACLE_HOME/bin   break
done

As others have mentioned, you could just rely on oraenv once you set the ORACLE_SID.

HTH, Steve Received on Fri Dec 07 2007 - 19:44:16 CST

Original text of this message

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