• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2066
  • Last Modified:

Where are my oracle environment variables being set

When I connect to one of my Solaris database servers several of my Oracle environment variables are already set.

ORACLE_BASE=/u01/home/oracle
ORACLE_ADMIN=/u01/home/oracle/admin
ORAENV_ASK=NO
ORACLE_HOME=/u01/home/oracle/product/10.2.0
ORAKITPATH=.
ORATERMPATH=.
ORACLE_SERVER=
ORATAB=/var/opt/oracle/oratab
ORACLE_TERM=sun

I cannot find in the /etc/profile or and profile file in my home directory where this is being set.
Where is this all happening?
0
TOWELLR
Asked:
TOWELLR
  • 5
  • 4
  • 3
  • +3
1 Solution
 
TintinCommented:
Please show us the contents of your .profile
0
 
johnsoneSenior Oracle DBACommented:
One other thing is can you tell us what shell you are using?  echo $SHELL should tell you.  .profile may not be run at login, especially is you are using csh.
0
 
Jinesh KamdarCommented:
For my DB, the "envfile" is responsible for setting these variables. Check if your DB has one too.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
TOWELLRAuthor Commented:
Here is the /etc/profile

# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

pathmunge () {
      if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
         if [ "$2" = "after" ] ; then
            PATH=$PATH:$1
         else
            PATH=$1:$PATH
         fi
      fi
}

# Path manipulation
if [ `id -u` = 0 ]; then
      pathmunge /sbin
      pathmunge /usr/sbin
      pathmunge /usr/local/sbin
fi

pathmunge /usr/X11R6/bin after


# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"

HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
          . $i
    fi
done

unset i
unset pathmunge
[ "" = "\s-\v\$ " ] && PS1="[\u@\h \W]\$ "


I also checked in the profile.d folder and it has a bunch of shell programs

-rwxr-xr-x  1 root root  764 Oct  4  2006 colorls.csh
-rwxr-xr-x  1 root root  713 Oct  4  2006 colorls.sh
-rwxr-xr-x  1 root root  192 Oct 13  2004 glib2.csh
-rwxr-xr-x  1 root root  190 Oct 13  2004 glib2.sh
-rwxr-xr-x  1 root root   58 Nov 10  2006 gnome-ssh-askpass.csh
-rwxr-xr-x  1 root root   70 Nov 10  2006 gnome-ssh-askpass.sh
-rwxr-xr-x  1 root root   78 Oct 17  2006 kde.csh
-rwxr-xr-x  1 root root   74 Oct 17  2006 kde.sh
-rwxr-xr-x  1 root root  218 Apr  5  2007 krb5.csh
-rwxr-xr-x  1 root root  210 Apr  5  2007 krb5.sh
-rwxr-xr-x  1 root root 2182 Feb 12  2007 lang.csh
-rwxr-xr-x  1 root root 2470 Feb 12  2007 lang.sh
-rwxr-xr-x  1 root root  122 Jul 25  2006 less.csh
-rwxr-xr-x  1 root root  108 Jul 25  2006 less.sh
-rwxr-xr-x  1 root root   51 Aug 11  2006 mc.csh
-rwxr-xr-x  1 root root   45 Aug 11  2006 mc.sh
-rwxr-xr-x  1 root root  104 Oct 23  2006 qt.csh
-rwxr-xr-x  1 root root  101 Oct 23  2006 qt.sh
-rwxr-xr-x  1 root root   13 Aug 10  2005 vim.csh
-rwxr-xr-x  1 root root  181 Aug 10  2005 vim.sh
-rwxr-xr-x  1 root root  170 Aug  7  2004 which-2.sh

Thanks
0
 
TOWELLRAuthor Commented:
my SHELL is /etc/csh
0
 
johnsoneSenior Oracle DBACommented:
If you are using csh, then you environment is set by .cshrc not .profile.  Look there.
0
 
joebednarzCommented:
Have you checked bashrc?
0
 
TOWELLRAuthor Commented:
here are the contents of csh.cshrc
It seems to again execute scripts in the profile.d folder

What is the easies way to determine if one of those scripts is setting the ORACLE_HOME

# /etc/cshrc
#
# csh configuration for all shell invocations.

# by default, we want this to get set.
# Even for non-interactive, non-login shells.
[ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]
if $status then
        umask 022
else
        umask 002
endif

if ($?prompt) then
  if ($?tcsh) then
    set prompt='[%n@%m %c]$ '
  else
    set prompt=\[`id -nu`@`hostname -s`\]\$\
  endif
endif

if ( $?tcsh ) then
        bindkey "^[[3~" delete-char
endif

setenv MAIL "/var/spool/mail/$USER"
limit coredumpsize 0

if ( -d /etc/profile.d ) then
        set nonomatch
        foreach i ( /etc/profile.d/*.csh )
                if ( -r $i ) then
                        source $i
                endif
        end
        unset i nonomatch
endif
0
 
TintinCommented:
Try

grep -i oracle /etc/profile.d/*.csh

0
 
omarfaridCommented:
As Tintin indicated it could be any of /etc/profile.d/*.csh

OR

the .login file in your home dir
0
 
omarfaridCommented:
Can you show the content of

.login and .cshrc in your home dir?
0
 
TOWELLRAuthor Commented:
grep -i oracle /etc/profile.d/*.csh returned nothing.

There is also no .login or .cshrc in the home dir.
0
 
omarfaridCommented:
How many files do you have in /etc/profile.d/*.csh?

Can you post their contents?
0
 
TOWELLRAuthor Commented:
Actually I found the file .cshrc in my login directory.  It seems to point to some homegrown config file in another directory configc.def

It includes the following lines

setenv ORACLE_BASE /u01/home/oracle
setenv ORACLE_ADMIN /u01/home/oracle/admin
setenv ORAENV_ASK NO
setenv ORACLE_HOME ~oracle
setenv PATH `echo ${PATH}`:`~oracle/bin/dbhome`/bin

0
 
TintinCommented:
Well, there's your answer.
0
 
omarfaridCommented:
That's great !

But when I asked you to look into this file and post it's content, you said that you could not find it. Where this file was hiding?
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 5
  • 4
  • 3
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now