1 2 3 Previous Next 42 Replies Latest reply: Oct 16, 2013 2:25 PM by saeed.sh110 RSS

    set oracle_home on installation database

    saeed.sh110

      when i want to run sqlplus on oracle 11gR2 the error is shown :

       

          command not found

      when i search it in net , i understand that ORACLE_HOME and ORACLE_BASE and ORACLE_SID and PATH is not set . when i set it with below command , and reboot the server or log out and log in , the parameters are change to the firs value

      van anyone help me ?

       

          ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

          export ORACLE_HOME

      can anyone help me ?

      Thanks

        • 1. Re: set oracle_home on installation database
          saurabh

          To make the environment variables permanent you need to set it in .bash_profile of the OS oracle user. You can take help of below link to set the variable permanently. go to the additional setup section.

           

          http://www.oracle-base.com/articles/11g/oracle-db-11gr2-installation-on-oracle-linux-5.php

          • 2. Re: set oracle_home on installation database
            DK2010

            Hi,

             

            First of all Why you reboot the server , for change this Value ?

            export command only set the Value for the session

            What is your OS ?

            you can edit the .profile/.bash_profile with Entries of ORACLE_HOME/OACLE_BASE/ORACLE_SID/PATH

             

            it will help you to set the default Environment.

             

            HTH

            • 3. Re: set oracle_home on installation database
              sybrand_b

              Sorry, but you would best use Oracle supplied oraenv script to do so, or you will end up with hardcoded directories everywhere.

              oraenv sets Oracle_home, Oracle_base and the PATH.

               

              You can call it in your .bash_profile

               

              ORAENV_ASK="NO"

              ORACLE_SID=<whatever>

              . oraenv

               

              This assumes you use /etc/oratab, what you of course do.

               

              ----------

              Sybrand Bakker

              Senior Oracle DBA

              • 4. Re: set oracle_home on installation database
                Pradeepcmst

                Hi Saeed,

                You need to set all your environment variables in your oracle user account bash profile. And logout from oracle account and log back in again with oracle account to take effect...

                 

                 

                Regards,

                Pradeep. V

                • 5. Re: set oracle_home on installation database
                  saeed.sh110

                  hi

                  my OS is centos 5.9 , and the bash_profile is eddited with this parameters but when i connect to server and try to conncet to sqlplus , " command not found " is shown . when i set the ORACLE_HOME and ORACLE_SID and ORACLE_BASE to real directories then sqlplus  will run

                  thanks

                  • 6. Re: set oracle_home on installation database
                    saeed.sh110

                    Hi

                    i do it but when i log out with oracle again , the parameters is not set

                    • 7. Re: set oracle_home on installation database
                      saeed.sh110

                      hi

                      my oracle_sid = orcl1 and when i want to use oraenv , it ask me ORACLE_SID = (oracle) and me set it to oracl1 , then it said your oracl_base for your oracl_home is /u01/app/oracle . but when i want to use sqlplus , at first set the oracle_home and path and oracle_sid then use that

                      • 8. Re: set oracle_home on installation database
                        sybrand_b

                        Just do EXACTLY as I wrote, so set ORAENV_ASK to NO and it will work.

                         

                        ------------

                        Sybrand Bakker

                        Senior Oracle DBA

                        • 9. Re: set oracle_home on installation database
                          saeed.sh110

                          Hi

                          is my bash_profile is true ?

                          because i can not solve the problem

                          ' # Oracle Settings

                          TMP=/tmp; export TMP

                          TMPDIR=$TMP; export TMPDIR

                           

                           

                          ORACLE_HOSTNAME=centos; export ORACLE_HOSTNAME

                          ORACLE_UNQNAME=orcl1; export ORACLE_UNQNAME

                          ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

                          ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME

                          ORACLE_SID=orcl1;

                          export ORACLE_SID

                           

                           

                          ORACLE_ASK=NO

                           

                           

                          PATH=/usr/sbin:$PATH; export PATH

                          PATH=$ORACLE_HOME/bin:$PATH; export PATH

                           

                           

                          LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

                          CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH `

                           

                          when i set these values with below , the sqlplus is available :



                           

                          export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

                           

                          export ORACLE_BASE=/u01/app/oracle

                          export PATH=$ORACLE_HOME/bin:$PATH

                          export ORACLE_SID=orcl1

                           

                          • 10. Re: set oracle_home on installation database
                            saeed.sh110

                            Hi

                            is my bash_profile is true ?

                            because i can not solve the problem

                            ' # Oracle Settings

                            TMP=/tmp; export TMP

                            TMPDIR=$TMP; export TMPDIR

                             

                             

                            ORACLE_HOSTNAME=centos; export ORACLE_HOSTNAME

                            ORACLE_UNQNAME=orcl1; export ORACLE_UNQNAME

                            ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

                            ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME

                            ORACLE_SID=orcl1;

                            export ORACLE_SID

                             

                             

                            ORACLE_ASK=NO

                             

                             

                            PATH=/usr/sbin:$PATH; export PATH

                            PATH=$ORACLE_HOME/bin:$PATH; export PATH

                             

                             

                            LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

                            CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH `

                             

                            when i set these values with below , the sqlplus is available :



                             

                            export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

                             

                            export ORACLE_BASE=/u01/app/oracle

                            export PATH=$ORACLE_HOME/bin:$PATH

                            export ORACLE_SID=orcl1

                            • 11. Re: set oracle_home on installation database
                              Pradeepcmst

                              Yes Saeed,

                               

                              These values are enough to make the sqlplus to execute.

                               

                              export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

                               

                              export ORACLE_BASE=/u01/app/oracle

                              export PATH=$ORACLE_HOME/bin:$PATH

                              export ORACLE_SID=orcl1

                               

                               

                              Thank you..

                              • 12. Re: set oracle_home on installation database
                                saeed.sh110

                                but i want to run oracle automaticallay . i dont want to set oracle_home and oracle_sid and etc every time i login ....

                                • 13. Re: set oracle_home on installation database
                                  saeed.sh110

                                  when i login with oracle user , and " echo $ORACLE_HOME " this return empty , and when i set the ORACLE_HOME and ORACLE_SID and PATH and ORACLE_BASE manually with " export " and then "echo $ORACLE_HOME" it return the correct value and sqlplus is available . but when i log out and lag in again the values are empty .

                                  i set /etc/oratab with this values :

                                   

                                   

                                  "

                                  # This file is used by ORACLE utilities.  It is created by root.sh and

                                  # updated by the Database Configuration Assistant when creating a

                                  # database.

                                   

                                   

                                  # A colon, ':', is used as the field terminator.  A new line terminates

                                  # the entry.  Lines beginning with a pound sign, '#', are comments.

                                  #

                                  # Entries are of the form:

                                  #   $ORACLE_SID:$ORACLE_HOME:<N|Y>:

                                  #

                                  # The first and second fields are the system identifier and home

                                  # directory of the database respectively.  The third filed indicates

                                  # to the dbstart utility that the database should , "Y", or should not,

                                  # "N", be brought up at system boot time.

                                  #

                                  # Multiple entries with the same $ORACLE_SID are not allowed.

                                  #

                                  #

                                  orcl1:/u01/app/oracle/product/11.2.0/db_1:Y

                                  "

                                  at the end i have one database on this server with dbname=orcl and instancename=orcl , because is not good , i delete its directory with " rm " command , and then install this new oracle database . is this create my porblem ?

                                  Thanks

                                  • 14. Re: set oracle_home on installation database
                                    Pradeepcmst

                                    Hi Saeed,

                                    you can add these entries in your bash profile of oracle user account. so that you no need to enter these details all time when you login with oracle user account.

                                     

                                    export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

                                     

                                    export ORACLE_BASE=/u01/app/oracle

                                    export PATH=$ORACLE_HOME/bin:$PATH

                                    export ORACLE_SID=orcl1

                                     

                                    step 1: just login to oracle user account

                                    step 2: Add these entries in your bash profile

                                     

                                    export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

                                     

                                    export ORACLE_BASE=/u01/app/oracle

                                    export PATH=$ORACLE_HOME/bin:$PATH

                                    export ORACLE_SID=orcl1

                                     

                                    step 3: Save your bash profile

                                    step 4: log out and login again with oracle user account.

                                    step 5: enter sqlplus and you can login to ur database as well.

                                     

                                    This would have solved your issue.

                                     

                                     

                                    Regards,

                                    Pradeep. V

                                    1 2 3 Previous Next