1 2 Previous Next 15 Replies Latest reply: Oct 16, 2012 8:31 PM by 670114 RSS

    database env

    864103
      hi all ,

      oracle 11 rac with asm on linux

      please your advice concern the below

      [oracle@medi01 ~]$ echo $ORACLE_HOME

      [oracle@medi01 ~]$ . .bash_profile
      [oracle@medi01 ~]$ echo $ORACLE_HOME
      /home/app/oracle/product/11.2.0
      [oracle@medi01 ~]$ echo $ORACLE_SID
      MEDI1
      [oracle@medi01 ~]$ sqlplus / as sysdba

      SQL*Plus: Release 11.2.0.2.0 Production on Mon Oct 15 10:54:04 2012

      Copyright (c) 1982, 2010, Oracle. All rights reserved.


      Connected to:
      Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
      With the Real Application Clusters and Automatic Storage Management options

      SQL>

      [oracle@medi01 ~]$ vi ~/.bash_profile
      export DB_HOME=$ORACLE_BASE/product/11.2.0
      export ORACLE_HOME=$DB_HOME
      export ORACLE_SID=MEDI1
      export ORACLE_TERM=xterm
      export BASE_PATH=/usr/sbin:$PATH
      export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

      export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
      export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

      if [ $USER = "oracle" ]; then
      if [ $SHELL = "/bin/ksh" ]; then
      ulimit -p 16384
      ulimit -n 65536
      else
      ulimit -u 16384 -n 65536
      fi
      fi

      alias grid_env='. /home/oracle/grid_env'
      alias db_env='. /home/oracle/db_env'

      umask 0022

      vi db_env
      export ORACLE_SID=MEDI1
      export ORACLE_HOME=$DB_HOME
      export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

      export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
      export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

      export ORACLE_SID=+ASM1
      export ORACLE_HOME=$GRID_HOME
      export PATH=$ORACLE_HOME/bin:$BASE_PATH

      export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
      export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib



      my question why it's not work as perminent i always when log in to server
      apply . .bash_profile

      ???
        • 1. Re: database env
          Helios-GunesEROL
          Hi;

          Yes you can put your env on your bash_profile

          Regard
          Helios
          • 2. Re: database env
            Osama_Mustafa
            Modify this one
            # .bash_profile
            
            # Get the aliases and functions
            if [ -f ~/.bashrc ]; then
            . ~/.bashrc
            fi
            
            # User specific environment and startup programs
            
            PATH=$PATH:$HOME/bin
            
            export PATH
            unset USERNAME
            
            ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
            ORACLE_HOME=/u01/app/oracle/product/8.1.7; export ORACLE_HOME
            ORACLE_SID=prod1ora; export ORACLE_SID
            PATH=$PATH:/u01/app/oracle/product/8.1.7/bin; export PATH
            umask 022
            http://www.mike-devlin.com/oracle/bash_profile_sample.htm
            • 3. Re: database env
              864103
              thanks i will check this tomorrow due to my VPN now not working.
              • 4. Re: database env
                864103
                Hi ,

                please see i try to modify this in 2 nodes but till now work not work as a permenent

                i modify the . bash_profile and then
                [oracle@medi01 ~]$ cd
                [oracle@medi01 ~]$ . .bash_profile
                [oracle@medi01 ~]$ echo $ORACLE_HOME
                /home/app/oracle/product/11.2.0
                [oracle@medi01 ~]$ echo $ORACLE_SID
                MEDI1
                [oracle@medi01 ~]$ sqlplus

                SQL*Plus: Release 11.2.0.2.0 Production on Tue Oct 16 09:22:23 2012

                Copyright (c) 1982, 2010, Oracle. All rights reserved.

                Enter user-name:


                and then when open new session on same ip address

                [oracle@medi02 ~]$ echo $ORACLE_HOME

                [oracle@medi02 ~]$

                [oracle@medi02 ~]$ echo $ORACLE_SID

                [oracle@medi02 ~]$ sqlplus
                bash: sqlplus: command not found
                [oracle@medi02 ~]$


                please your advice
                • 5. Re: database env
                  Osama_Mustafa
                  What is your OS version !!!
                  • 6. Re: database env
                    864103
                    please see the below

                    [root@medi02 ~]# uname -a
                    Linux medi02 2.6.32-100.26.2.el5 #1 SMP Tue Jan 18 20:11:49 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
                    [root@medi02 ~]# uname -o
                    GNU/Linux
                    [root@medi02 ~]#


                    Connected to:
                    Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
                    With the Real Application Clusters and Automatic Storage Management options
                    • 7. Re: database env
                      Osama_Mustafa
                      Well only solution you got is adding . $HOME/.profile to your ~/.bashrc (if this file not exists then etc/bash.bashrc)
                      • 8. Re: database env
                        840254
                        Hi,for you

                        [ASM ID]:/u01/app/oracle/product/11.2.0/grid:N
                        [DB ID]:/u01/app/oracle/product/11.2.0/db_1:N
                        adding 2 rows above to */etc/oratab* file
                        and when you want to change ID you can type
                        *$. oraenv*
                        and then enter your ID


                        Thank,
                        Trung Hieu
                        • 9. Re: database env
                          864103
                          sorry but the same issue
                          [oracle@medi01 ~]$ vi ~/.bashrc


                          # .bashrc

                          # Source global definitions
                          if [ -f /etc/bashrc ]; then
                          . /etc/bashrc
                          $HOME/.profile
                          fi
                          # User specific aliases and functions
                          • 10. Re: database env
                            Osama_Mustafa
                            $HOME/.profile
                            Really do you accept this to work like this it must be

                            . $HOME/.profile and change $HOME To location for bash_profile
                            • 11. Re: database env
                              864103
                              hi ,

                              please see i edit this file and i was added ./HOME/.bash_profile

                              and then

                              cd
                              . .bash_profile it's take more time


                              su oracle not work also take more time and then failed
                              • 12. Re: database env
                                Osama_Mustafa
                                since its taking time then its reading from the file you should make sure yoiu set everything is OK i can't know what you did
                                • 13. Re: database env
                                  864103
                                  i just add

                                  # .bashrc

                                  # Source global definitions
                                  if [ -f /etc/bashrc ]; then
                                  . /etc/bashrc
                                  .$HOME/.bash_profile
                                  fi

                                  # User specific aliases and functions


                                  i do this for only one node
                                  we have rac node 1 on medi01 node 2 on medi2
                                  i change this file on node 1 now the node one oracle user can't access the server root okay ,
                                  other node it's okay , please advice
                                  • 14. Re: database env
                                    864103
                                    finally i get this

                                    from user root
                                    cd ~oracle
                                    and then vi .bashrc

                                    and edit the file and now i can su oracle

                                    but the problem still exist

                                    [oracle@medi01 ~]$ echo $ORACLE_HOME

                                    [oracle@medi01 ~]$ echo $ORACLE_SID

                                    [oracle@medi01 ~]$ sqlplus
                                    bash: sqlplus: command not found
                                    [oracle@medi01 ~]$
                                    1 2 Previous Next