11 Replies Latest reply: Feb 3, 2013 6:03 PM by marksmithusa RSS

    set environment variable

    941949
      hii everybody,
      how to set environment variable in profile? i have oracle 10g db (10.2.0.3)
      and linux platform(redhat 5.7).
      thanks.
        • 1. Re: set environment variable
          Girish Sharma
          Asking of question is not an offence any more, but there is a rule behind getting help i.e. a person is sinking in a deep water and he tries to save his life, so he shows his efforts to save the life and tries to grab the land. If someone sees that person is sinking in water then they dive into the water and rush for save the person. If someone sees that person is sinking but not trying to save his life, then how and why other will rush to save him.. may be he is going to suicide.

          Your below question text is seems me second one. You just posted the question text, but not showing us what you did, what error you got, what environment variable you want to set in your profile, did you google for it ? You did nothing, just got a question and posted here.

          I am not going to attack, but wish to elaborate this is not the way to learn the things. First try yourself, see what happens, google and if all fails then raise your hands for help, there are many hands to pick your "needing" hands for sure.

          Regards
          Girish Sharma
          • 2. Re: set environment variable
            941949
            hii sir,
            i m getting the error shown below,
            -bash: /opt/oracle/test_db.env:no such file or directory.your help is highly appreciated thanks.
            • 3. Re: set environment variable
              yoonas
              Hi,

              You mean bash_profile ?

              Do you have the file(test_db.env) at this loccation /opt/oracle/?

              see if the files is there with "ls -l /opt/oracle/", before you can source , the file has to be present there

              Regards
              Yoonas
              • 4. Re: set environment variable
                941949
                yes file test_db.env is present in location /opt/oracle but oracle_home is not set.how to set oracle home now?

                Edited by: 938946 on Feb 3, 2013 4:32 AM
                • 5. Re: set environment variable
                  Srini Chavali-Oracle
                  Pl post the contents of your bash profile file and test_db.env file

                  HTH
                  Srini
                  • 6. Re: set environment variable
                    yoonas
                    can you post the output of 'ls -l /opt/oracle/test_db.env'
                    • 7. Re: set environment variable
                      941949
                      can you please tell me how to set the profile in unix
                      • 8. Re: set environment variable
                        yoonas
                        http://lmgtfy.com/?q=unix+profile

                        http://manuals.its.virginia.edu/unixtut/unix8.html

                        you can even see cat /etc/profile
                        • 9. Re: set environment variable
                          Paul M.
                          Here an example of a basic .bash_profile for oracle user :
                          # .bash_profile
                          
                          # Get the aliases and functions
                          if [ -f ~/.bashrc ]; then
                                  . ~/.bashrc
                          fi
                          
                          export ORACLE_BASE=/opt/app/oracle
                          export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
                          export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib32:$ORACLE_HOME/lib
                          export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
                          export ORACLE_SID=ORCL
                          Of course change paths and names with yours.
                          • 10. Re: set environment variable
                            Osama_Mustafa
                            http://www.mike-devlin.com/oracle/bash_profile_sample.htm
                            • 11. Re: set environment variable
                              marksmithusa
                              Your .env file is not where your user profile expects it. Either find this file and move it to the right place or create a new file.

                              Check your user profile by doing this: more $HOME/.bash_profile. Find the reference for the .env file.

                              If you can't resolve, you can always set your environment by doing this: .oraenv.

                              If that doesn't work, make us that our PATH variable includes /usr/local/bin: echo $PATH

                              Either add the /usr/local/bin to the PATH variable or call the oraenv file from the directory: . /usr/local/bin/oraenv

                              When you get oraenv to work, it will prompt you for an ORACLE_SID and then set your environment for you.