COMMAND NOT FOUND - ORACLE GRID

Ujjwal Rana

    Hello Everyone,

    While typing any of the below mentioned command I received command not found. I wonder what could be the reason. I have installed ORACLE GRID on my test server. Also Please feel free to check bash_profile output for grid from below :-

     

    [grid@storage Desktop]$ sqlplus / as sysdba

    bash: sqlplus: command not found

    [grid@storage Desktop]$ asmca

    bash: asmca: command not found

    [grid@storage Desktop]$ lsnrctl status

    bash: lsnrctl: command not found

    [grid@storage Desktop]$

     

    [grid@storage Desktop]$ vi ~/.bash_profile

    # .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

     

    ORACLE_SID=+ASM; export ORACLE_SID

    JAVA_HOME=/usr/local/java; export JAVA_HOME

    ORACLE_BASE=/u01/app/grid; export ORACLE_BASE

    ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME

    ORACLE_TERM=xterm; export ORACLE_TERM

    NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT

    TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

    ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11

    PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin

    PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

    PATH=${PATH}:/u01/app/common/oracle/bin

    export PATH

    LD_LIBRARY_PATH=$ORACLE_HOME/lib

    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib

    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

    export LD_LIBRARY_PATH

    CLASSPATH=$ORACLE_HOME/JRE

    CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib

    CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib

    CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib

    export CLASSPATH

    THREADS_FLAG=native; export THREADS_FLAG

    export TEMP=/tmp

    export TMPDIR=/tmp

    umask 022

     

     

    Also you might need to check ORACLE USER .bash_profile OUTPUT as well. Below is an OUTPUT

     

    [oracle@storage ~]$  vi ~/.bash_profile

    # .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

     

    ORACLE_SID=orcl; export ORACLE_SID

    ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME

    JAVA_HOME=/usr/local/java; export JAVA_HOME

    ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

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

    ORACLE_TERM=xterm; export ORACLE_TERM

    NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT

    TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

    ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11

    PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin

    PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

    PATH=${PATH}:/u01/app/common/oracle/bin

    export PATH

    LD_LIBRARY_PATH=$ORACLE_HOME/lib

    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib

    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

    export LD_LIBRARY_PATH

    CLASSPATH=$ORACLE_HOME/JRE

    CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib

    CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib

    CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib

    export CLASSPATH

    THREADS_FLAG=native; export THREADS_FLAG

    export TEMP=/tmp

    export TMPDIR=/tmp

    umask 022

      • 1. Re: COMMAND NOT FOUND - ORACLE GRID
        Pavan Kumar

        Hi,

         

        PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin

         

        what is $HOME/bin ?

        A semicolon ends for every setting which is missing as per my knowledge
        Try below method, add new variables at start and append the current variable of paths to last (good way)

         

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

         

        Hope it works

         

        - Pavan  Kumar N

        • 2. Re: COMMAND NOT FOUND - ORACLE GRID
          Ujjwal Rana

          Hi Pavan,

          I did that and refresh the bash_profile but still the same thing occured : COMMAND NOT FOUND.. Please feel free to check the screenshot below

           

          [grid@storage Desktop]$ source ~/.bash_profile

           

          [grid@storage Desktop]$  lsnrctl status

          bash: lsnrctl: command not found

           

          [grid@storage Desktop]$  sqlplus / as sysdba

          bash: sqlplus: command not found

          [grid@storage Desktop]$

           

          Screenshot-grid@storage:~-Desktop.png

          • 3. Re: COMMAND NOT FOUND - ORACLE GRID
            ORASCN

            Hi ,

             

            Is your Oracle Home and Oracle Base are correct?

             

            ORACLE_BASE=/u01/app/grid; export ORACLE_BASE

            ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME

             

            Which one is the correct one?

             

            Regards,

            Veera

            • 4. Re: COMMAND NOT FOUND - ORACLE GRID
              Pavan Kumar

              Better you try it some source file instead of bash for time being whether issue with paths /command or bash execution

               

              [root@host1 Desktop]# ## fresh session

              [root@host1 Desktop]# su - oracle

              Last login: Sun Dec 27 14:20:55 IST 2015 on pts/2

               

              [oracle@host1 ~]$ cat demo1.sh


              TMP=/tmp; export TMP
              TMPDIR=$TMP; export TMPDIR

              ORACLE_SID=demo1; export ORACLE_SID
              ORACLE_HOSTNAME=`hostname`; export ORACLE_HOSTNAME
              ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
              ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1; export ORACLE_HOME

              PATH=/usr/sbin:$PATH; export PATH
              PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$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

              alias oh="cd $ORACLE_HOME"
              alias ob="cd $ORACLE_BASE"
              alias sqls="sqlplus / as sysdba"
              alias alertt="tail -f /u01/app/oracle/diag/rdbms/demo1/demo1/trace/alert_demo1.log"
              alias alert="cd /u01/app/oracle/diag/rdbms/demo1/demo1/trace/"
              alias tns="cd $ORACLE_HOME/network/admin"

               

              [oracle@host1 ~]$ ## Your source of settings

               

              [oracle@host1 ~]$ export ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
              [oracle@host1 ~]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1; export ORACLE_HOME
              [oracle@host1 ~]$ export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH; export PATH
              [oracle@host1 ~]$ which sqlplus
              /u01/app/oracle/product/12.1.0/dbhome_1/bin/sqlplus

               

              [oracle@host1 ~]$ PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
              [oracle@host1 ~]$ export PATH
              [oracle@host1 ~]$ which sqlplus
              /u01/app/oracle/product/12.1.0/dbhome_1/bin/sqlplus

               

              works fine for me

               

              - Pavan Kumar N

              • 5. Re: COMMAND NOT FOUND - ORACLE GRID
                Ujjwal Rana

                I have installed oracle with grid therefore both of them are correct

                 

                [grid@storage Desktop]$ echo $ORACLE_BASE

                /u01/app/grid

                 

                [grid@storage Desktop]$  echo $ORACLE_HOME

                /u01/app/11.2.0/grid

                 

                [grid@storage Desktop]$

                • 6. Re: COMMAND NOT FOUND - ORACLE GRID
                  Ujjwal Rana

                  Hi Pavan,

                  As per your instruction this is what i did

                   

                  [grid@storage Desktop]$  su - root

                  Password:

                  [root@storage ~]#  fresh session

                  -bash: fresh: command not found

                  [root@storage ~]# fresh session

                  -bash: fresh: command not found

                  [root@storage ~]# #fresh session

                  [root@storage ~]# su - oracle

                  [oracle@storage ~]$ cat demo1.sh

                  cat: demo1.sh: No such file or directory

                  [oracle@storage ~]$ vi demo1.sh

                  TMP=/tmp; export TMP

                  TMPDIR=$TMP; export TMPDIR

                   

                  ORACLE_SID=demo1; export ORACLE_SID

                  ORACLE_HOSTNAME=`hostname`; export ORACLE_HOSTNAME

                  ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

                  ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1; export ORACLE_HOME

                   

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

                  PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$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

                   

                  alias oh="cd $ORACLE_HOME"

                  alias ob="cd $ORACLE_BASE"

                  alias sqls="sqlplus / as sysdba"

                  alias alertt="tail -f /u01/app/oracle/diag/rdbms/demo1/demo1/trace/alert_demo1.log"

                  alias alert="cd /u01/app/oracle/diag/rdbms/demo1/demo1/trace/"

                  alias tns="cd $ORACLE_HOME/network/admin"

                   

                  ========================

                  [oracle@storage ~]$ export ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

                  [oracle@storage ~]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1; export ORACLE_HOME

                  [oracle@storage ~]$ export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH; export PATH

                  [oracle@storage ~]$ which sqlplus

                  /u01/app/oracle/product/11.2.0/db_1/bin/sqlplus

                  [oracle@storage ~]$ PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

                  [oracle@storage ~]$ export PATH

                  [oracle@storage ~]$ which sqlplus

                  /u01/app/oracle/product/11.2.0/db_1/bin/sqlplus

                  [oracle@storage ~]$

                   

                  [oracle@storage ~]$ sqlplus / as sysdba

                  Error 6 initializing SQL*Plus

                  SP2-0667: Message file sp1<lang>.msb not found

                  SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

                  [oracle@storage ~]$

                   

                   

                  [grid@storage Desktop]$ sqlplus / as sysdba

                  bash: sqlplus: command not found

                  [grid@storage Desktop]$

                   

                   

                  NOT WORKING

                  • 7. Re: COMMAND NOT FOUND - ORACLE GRID
                    Aman....

                    Ujjwal Rana wrote:

                     

                    Hello Everyone,

                    While typing any of the below mentioned command I received command not found. I wonder what could be the reason. I have installed ORACLE GRID on my test server. Also Please feel free to check bash_profile output for grid from below :-

                     

                    [grid@storage Desktop]$ sqlplus / as sysdba

                    bash: sqlplus: command not found

                    [grid@storage Desktop]$ asmca

                    bash: asmca: command not found

                    [grid@storage Desktop]$ lsnrctl status

                    bash: lsnrctl: command not found

                    [grid@storage Desktop]$

                     

                    [grid@storage Desktop]$ vi ~/.bash_profile

                    # .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

                     

                    ORACLE_SID=+ASM; export ORACLE_SID

                    JAVA_HOME=/usr/local/java; export JAVA_HOME

                    ORACLE_BASE=/u01/app/grid; export ORACLE_BASE

                    ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME

                    ORACLE_TERM=xterm; export ORACLE_TERM

                    NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT

                    TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

                    ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11

                    PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin

                    PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

                    PATH=${PATH}:/u01/app/common/oracle/bin

                    export PATH

                    LD_LIBRARY_PATH=$ORACLE_HOME/lib

                    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib

                    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

                    export LD_LIBRARY_PATH

                    CLASSPATH=$ORACLE_HOME/JRE

                    CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib

                    CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib

                    CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib

                    export CLASSPATH

                    THREADS_FLAG=native; export THREADS_FLAG

                    export TEMP=/tmp

                    export TMPDIR=/tmp

                    umask 022

                     

                     

                    Also you might need to check ORACLE USER .bash_profile OUTPUT as well. Below is an OUTPUT

                     

                    [oracle@storage ~]$  vi ~/.bash_profile

                    # .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

                     

                    ORACLE_SID=orcl; export ORACLE_SID

                    ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME

                    JAVA_HOME=/usr/local/java; export JAVA_HOME

                    ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

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

                    ORACLE_TERM=xterm; export ORACLE_TERM

                    NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT

                    TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

                    ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11

                    PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin

                    PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

                    PATH=${PATH}:/u01/app/common/oracle/bin

                    export PATH

                    LD_LIBRARY_PATH=$ORACLE_HOME/lib

                    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib

                    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

                    export LD_LIBRARY_PATH

                    CLASSPATH=$ORACLE_HOME/JRE

                    CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib

                    CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib

                    CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib

                    export CLASSPATH

                    THREADS_FLAG=native; export THREADS_FLAG

                    export TEMP=/tmp

                    export TMPDIR=/tmp

                    umask 022

                    The Path needs to point to the BIN folder of the Oracle Home(GI Home) to launch the ASMCA. Follow the changes suggeseted by Pavan else, edit your /etc/oratab file and enter there the details of your SID along with the Oracle Home information. After doing so-use . oraenv(notice the dot ) and enter the SID . It should point you to the right Oracle Home.

                     

                    HTH

                    Aman....

                    • 8. Re: COMMAND NOT FOUND - ORACLE GRID
                      Pavan Kumar

                      I have just given basic stuff for you understanding...

                       

                      Error 6 initializing SQL*Plus

                      SP2-0667: Message file sp1<lang>.msb not found

                      SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

                      With out below stuff

                       

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

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

                       

                      your message will not get opened

                      demo1.sh file is at my end, how can you expect at your end ...

                       

                      - Pavan Kumar N

                      • 9. Re: COMMAND NOT FOUND - ORACLE GRID
                        Ujjwal Rana

                        Right now this is what availalbe insidde /etc/oratab

                         

                        [root@storage ~]#  cat /etc/oratab

                        #Backup file is  /u01/app/11.2.0/grid/srvm/admin/oratab.bak.storage line added by Agent

                        #

                         

                        +ASM:/u01/app/11.2.0/grid:N

                        orcl:/u01/app/oracle/product/11.2.0/db_1:N        # line added by Agent

                        • 10. Re: COMMAND NOT FOUND - ORACLE GRID
                          Ujjwal Rana

                          Sorry my bad. I thought to create a dummy like what you have provided.

                          • 11. Re: COMMAND NOT FOUND - ORACLE GRID
                            Aman....

                            Ujjwal Rana wrote:

                             

                            Right now this is what availalbe insidde /etc/oratab

                             

                            [root@storage ~]#  cat /etc/oratab

                            #Backup file is  /u01/app/11.2.0/grid/srvm/admin/oratab.bak.storage line added by Agent

                            #

                             

                            +ASM:/u01/app/11.2.0/grid:N

                            orcl:/u01/app/oracle/product/11.2.0/db_1:N        # line added by Agent

                            Since you want to use ASMCA, so enter when asked while executing .oraenv , +ASM. Show us the output here.

                             

                            Aman....

                            • 12. Re: COMMAND NOT FOUND - ORACLE GRID
                              Pavan Kumar

                              Hi,

                               

                              My oratab

                              +ASM1:/u01/app/11.2.0/grid:N  # line added by Agent

                              racdb:/u03/app/11.2.0/db_home:N  # line added by Agent

                               

                              My grid.env script

                               

                              [oracle@rac1 ~]$ cat grid.env


                              TMP=/tmp; export TMP
                              TMPDIR=$TMP; export TMPDIR

                               

                              ORACLE_SID=+ASM1; export ORACLE_SID
                              ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
                              ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
                              ORACLE_TERM=xterm; export ORACLE_TERM
                              LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH

                               

                              PATH=/usr/sbin:$PATH; export PATH
                              PATH=$ORACLE_HOME/bin:$LD_LIBRARY_PATH:$PATH; export PATH

                               

                              ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
                              TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

                               

                              CLASSPATH=$ORACLE_HOME/JRE
                              CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
                              CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
                              CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib

                               


                              If the above works you can use it.

                               

                              - Pavan Kumar N

                              • 13. Re: COMMAND NOT FOUND - ORACLE GRID
                                Aman....

                                The file is needed if you don't want to enter the SID information every time when you log-in .I haven't have added anything in my profile file. Here is what  I have in my ORATAB file.

                                --REM contents of ORATAB

                                orcl:/u01/app/oracle/product/12.1.0.2/dbhome_1:N

                                orcldb:/u01/app/oracle/product/12.1.0.2/dbhome_1:

                                 

                                [oracle@test12 ~]$ cat .bash_profile

                                # .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

                                 

                                [oracle@test12 ~]$ . oraenv

                                ORACLE_SID = [orcl] ? nosid

                                ORACLE_HOME = [/home/oracle] ?

                                ORACLE_BASE environment variable is not being set since this

                                information is not available for the current user ID oracle.

                                You can set ORACLE_BASE manually if it is required.

                                Resetting ORACLE_BASE to its previous value or ORACLE_HOME

                                The Oracle base remains unchanged with value /u01/app/oracle

                                [oracle@test12 ~]$ sqlplus

                                bash: sqlplus: command not found

                                [oracle@test12 ~]$ . oraenv

                                ORACLE_SID = [nosid] ? orcldb

                                The Oracle base remains unchanged with value /u01/app/oracle

                                [oracle@test12 ~]$ which sqlplus

                                /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/sqlplus

                                [oracle@test12 ~]$

                                As I mentioned before, show us the output after putting +ASM in the . oraenv.

                                 

                                HTH

                                Aman....

                                • 14. Re: COMMAND NOT FOUND - ORACLE GRID
                                  Ujjwal Rana

                                  You might want to see this

                                   

                                  [oracle@storage ~]$ sqlplus / as sysdba

                                   

                                  SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 27 15:23:43 2015

                                   

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

                                   

                                  Connected to an idle instance.

                                   

                                  SQL>

                                  1 2 3 上一个 下一个