4 Replies Latest reply: May 16, 2014 2:23 PM by EdStevens RSS

    Setting Oracle Environment

    user13419193

      Hii,

       

      Well i m facing problem in setting Oracle Environment

      I had install ORACLE 11g R2 on Oracle Linux 5.7 on virtual machine.

      Actually i want to fix up oracle environment so  that i dont have to export everytime.

      I fix up oracle environment in .bash_profile in root user and its working, i mean sqlplus is connected and i can open database but when i fix for my user name 'Oracle' .bash_profile,

      receive and error

      -ksh : sqlplus: not found (No such file and directory)

       

      One more thing when i give all export directly on terminal of User 'Oracle' than its work.

      export ORACLE_BASE = /u01/app/oracle

      export ORACLE-HOME = /u01/app/oracle/product/11.2.0/dbhome_1

      export ORACLE_SID=orcl

      export PATH=$ORACLE_HOME/bin:$PATH

       

      Anybody can help me to solve my problem, plzzz..

        • 1. Re: Setting Oracle Environment
          Iridium

          Hi

          Maybe you are configuring it in the wrong place, the error says -ksh, ksh is not bash, checkit out as oracle:

          $ env|grep SHELL

          SHELL=/bin/ksh

          $

          ksh uses .profile instead of .bash_profile

          Hope this helps

          Regards

          • 2. Re: Setting Oracle Environment
            Ratnesh Kumar Roy

            Hi,

             

            It means that  you have not set up PATH correctly

             

            export ORACLE-HOME = /u01/app/oracle/product/11.2.0/dbhome_1

            export ORACLE_SID=orcl

            export PATH=$ORACLE_HOME/bin:$PATH

             

            Now check echo $ORACLE_HOME and echo $PATH is set properly or not.

             

            if it is not working then do like this

             

            cd /u01/app/oracle/product/11.2.0/dbhome_1/bin

            sqlplus / as sysdba

            • 3. Re: Setting Oracle Environment
              user13419193

              Hii,

               

              Thanks for reply

              i check the SHELL from 'Oracle' user and it give me

              SHELL=/bin/ksh

               

              I check list of all files in my home directory by giving cmd

              ls -a

              there is no .profile in which i can edit path.

              Then after, I just change the login Shell of user 'Oracle' to /bin/bash and so now it works.

              Does this means i can't use ksh Shell??

              Is .profile is for Unix?? and linux has .bash_profile

               

              thnks.

              • 4. Re: Setting Oracle Environment
                EdStevens

                user13419193 wrote:

                 

                First off - referring back to your opening post -- you shouldn't be doing anything with oracle while logged on as root.  Period. End of Story.  Full stop.

                 

                 

                Hii,

                 

                Thanks for reply

                i check the SHELL from 'Oracle' user and it give me

                SHELL=/bin/ksh

                 

                I check list of all files in my home directory by giving cmd

                ls -a

                there is no .profile in which i can edit path.

                Nothing prevents you from creating one.  But better is to fix your default ... which I see you did in the next step

                 

                 

                Then after, I just change the login Shell of user 'Oracle' to /bin/bash and so now it works.

                Congratulations.  You just discovered the wisdom of using the defaults.

                 

                 

                Does this means i can't use ksh Shell??

                It just means that ksh won't be your default shell.  And given that it's not the default for your OS, you really don't want it to be the default for your own use.

                 

                 

                Is .profile is for Unix?? and linux has .bash_profile

                I'm not sure but I think it may depend on the distribution.  There really is no "one" Unix, nor is there "one" Linux.  I first learned "Unix" on Solaris.  When I added AIX to my portfolio I had to learn that 1) some of the thing I thought were "unix standards" were just Solaris standards, and 2) some things I though were Solaris standards were just the standards of the admins on my first Solaris machine.

                 

                And the follow-on lesson from 1 and 2 were to learn to accept and adapt to the standards of whatever system I'm on and don't try to bend it to meet whatever standard was on some other flavor of *nix or under some other SA's control. 

                 

                thnks.