1 2 Previous Next 23 Replies Latest reply: Mar 12, 2012 5:51 AM by Nonuday RSS

    Why .bash_profile

    Nonuday
      Hi Experts,

      Can you clear my doubts on .bash_profile.

      1. When and why should we create .bash_profile (After/Before installing Oracle)
      2. I have a Linux machine where I want to install Oracle, when I try to edit the .bash_profile before installing oracle. I got the below error.

      -bash-3.2$ ~/.bash_profile
      -bash: /oracle/home/oracle/.bash_profile: No such file or directory

      After searching in oracle forum, I have used the suggestions given by the experts and got the below results:

      -bash-3.2$ echo $SHELL
      */bin/bash*

      -bash-3.2$ more /etc/passwd | grep oracle
      oracle:x:502:503::/oracle/home/oracle:/bin/bash

      My home path was correct where I was trying to edit .bash_profile but got error stating "No Such file", So again I tried another Suggestion,

      -bash-3.2$  ls -la | grep .bash_profile
      -rw-r--r-- 1 oracle dba     0 Mar 12 17:00 .bash_profile

      The above command shows that .bash_profile is present but I am not able to find where?

      When I tried to open with cat command, it shows nothing..

      3. Can I install Oracle without setting .bash_profile, will this installation work?

      Can anyone explain and clear my doubts please....

      OS -RHEL 5.7
      ORACLE DATABASE 11.2.0.3


      Thanks in advance..
        • 1. Re: Why .bash_profile
          Fran
          1.- You must have .bash_profile, it is configured before installation
          2.- I think you are using a wrong user, try it like root (or any super-user)
          3.- No, it doesn't work.

          Please check:
          http://docs.oracle.com/cd/B28359_01/install.111/b32002/toc.htm
          http://docs.oracle.com/cd/B28359_01/install.111/b32281/toc.htm
          • 2. Re: Why .bash_profile
            Nonuday
            Fran wrote:
            1.- You must have .bash_profile, it is configured before installation
            If it must be configured can I create it by my own since am not able to find the file.

            2.- I think you are using a wrong user, try it like root (or any super-user)
            My user is Oracle with group dba and oinstall

            -bash-3.2$ who am i
            oracle   pts/5        2012-03-12 16:49 (10.93.10.15)

            3.- No, it doesn't work.
            Can you tell me how to find the .bash_profile


            Thanks for your response Fran
            • 3. Re: Why .bash_profile
              Fran
              8 Configuring the oracle User's Environment <-- second link i posted
              • 4. Re: Why .bash_profile
                startup
                HI,

                1.Before installing of oracle software you have to set .bash_profile and once run these commands
                2. cat /etc/skel./.bash_profile > ~/.bash_profile
                cat /etc/skel/.bashrc > ~/.bashrc
                3.u can't install without setting .bash_profile
                • 5. Re: Why .bash_profile
                  Nonuday
                  Fran wrote:
                  8 Configuring the oracle User's Environment <-- second link i posted
                  Yes, I tried the steps from the link, but when I give the following as ". ./.bash_profile" it shows nothing apart fromt he Shell prompt :(

                  bash-3.2$ echo $SHELL
                  */bin/bash*
                  bash-3.2$ . ./.bash_profile
                  bash-3.2$ . ./.bash_profile
                  bash-3.2$



                  Thanks Fran...
                  • 6. Re: Why .bash_profile
                    Nonuday
                    startup wrote:
                    HI,

                    1.Before installing of oracle software you have to set .bash_profile and once run these commands
                    To set .bash_profile am not able to open the file. the system throws an error saying "No such File".


                    Thanks for your response

                    Edited by: 897910 on Mar 12, 2012 2:58 AM
                    • 7. Re: Why .bash_profile
                      Helios-GunesEROL
                      Hi;

                      Please see:

                      What is .bash_profile
                      http://damnsmalllinux.org/wiki/index.php/.bash_profile
                      http://bash.cyberciti.biz/guide/.bash_profile

                      Regard
                      Helios
                      • 8. Re: Why .bash_profile
                        SSR
                        1. When and why should we create .bash_profile (After/Before installing Oracle)
                        .bash_profile file contains details like the environment variable; ORACLE_HOME, ORACLE_SID, PATH. Its better to create this file before installation but not mandatory.
                        3. Can I install Oracle without setting .bash_profile, will this installation work?
                        You can install oracle without setting profile, just execute runInstaller. But if you set all the required environment, the oracle consider those env. For example, if you have set ORACLE_HOME, then when you start with installation, as the home path is already define it will consider the same path for home. You need to set display, set umask. In short if you don't create bash_profile you will need to set env variable explicitly.
                        • 9. Re: Why .bash_profile
                          Nonuday
                          Helios- Gunes EROL wrote:
                          Hi;

                          Please see:

                          What is .bash_profile
                          http://damnsmalllinux.org/wiki/index.php/.bash_profile
                          http://bash.cyberciti.biz/guide/.bash_profile

                          Regard
                          Helios
                          Thanks Helios, I was able to understand what is .bash_profile. My current situation is how to set environment variables in .bash_profile which am not able to open.

                          Karthik
                          • 10. Re: Why .bash_profile
                            Nonuday
                            SSR wrote:
                            1. When and why should we create .bash_profile (After/Before installing Oracle)
                            .bash_profile file contains details like the environment variable; ORACLE_HOME, ORACLE_SID, PATH. Its better to create this file before installation but not mandatory.
                            3. Can I install Oracle without setting .bash_profile, will this installation work?
                            You can install oracle without setting profile, just execute runInstaller. But if you set all the required environment, the oracle consider those env. For example, if you have set ORACLE_HOME, then when you start with installation, as the home path is already define it will consider the same path for home. You need to set display, set umask. In short if you don't create bash_profile you will need to set env variable explicitly.
                            Thanks a lot for your explanation SSR.. I got the purpose of .bash_profile..

                            But can you tell me why am I getting an error saying "No such file". To set env in bash I need to edit the file.

                            Thanks,
                            Karthik
                            • 11. Re: Why .bash_profile
                              Nonuday
                              Hi SSR,

                              If I am having 2 oracle versions like Oracle 10g and 11g. Then can I mention/set both the ORACLE_HOME path and ORACLE_SID name in the bash_profile?


                              Thanks...
                              • 12. Re: Why .bash_profile
                                sybrand_b
                                Use oraenv!!!

                                Comes with Oracle!

                                --------
                                Sybrand Bakker
                                Senior Oracle DBA
                                • 13. Re: Why .bash_profile
                                  Liron Amitzi
                                  >
                                  Fran wrote:
                                  1.- You must have .bash_profile, it is configured before installation
                                  2.- I think you are using a wrong user, try it like root (or any super-user)
                                  3.- No, it doesn't work.
                                  >

                                  Sorry Fran, but this is incorrect. The .bash_profile simply sets your environment variables. If you do it manually (using the export command) you can install Oracle without any problem and set the .bash_profile later.

                                  @897910
                                  What exactly are youy trying to do?
                                  >
                                  -bash-3.2$ ~/.bash_profile
                                  >
                                  This tries to execute the file, you should not execute this file, you should use it to define environment variables, then logoff and logon or "include it" using:
                                  -bash-3.2$ . ~/.bash_profile
                                  (dot space and then the file path and name)
                                  After you do that, check if the environment variables are set using the "echo" command. If they are, you are ready to install Oracle.

                                  HTH
                                  Liron
                                  • 14. Re: Why .bash_profile
                                    Nonuday
                                    sybrand_b wrote:
                                    Use oraenv!!!

                                    Comes with Oracle!
                                    I have not installed oracle yet


                                    Thanks
                                    1 2 Previous Next