Forum Stats

  • 3,749,914 Users
  • 2,250,074 Discussions
  • 7,866,690 Comments

Discussions

COMMAND NOT FOUND - ORACLE GRID

Ujjwal Rana
Ujjwal Rana Member Posts: 273
edited Jan 8, 2016 5:02AM in General Database Discussions

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 :-

[[email protected] Desktop]$ sqlplus / as sysdba

bash: sqlplus: command not found

[[email protected] Desktop]$ asmca

bash: asmca: command not found

[[email protected] Desktop]$ lsnrctl status

bash: lsnrctl: command not found

[[email protected] Desktop]$

[[email protected] 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

[[email protected] ~]$  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

Pavan Kumar

Best Answer

«13456710

Answers

  • Pavan Kumar
    Pavan Kumar Member Posts: 11,904 Gold Crown
    edited Dec 27, 2015 2:01AM

    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

  • Ujjwal Rana
    Ujjwal Rana Member Posts: 273
    edited Dec 27, 2015 3:43AM

    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

    [[email protected] Desktop]$ source ~/.bash_profile

    [[email protected] Desktop]$  lsnrctl status

    bash: lsnrctl: command not found

    [[email protected] Desktop]$  sqlplus / as sysdba

    bash: sqlplus: command not found

    [[email protected] Desktop]$

    Screenshot-grid@storage:~-Desktop.png

  • ORASCN
    ORASCN Member Posts: 1,806 Gold Trophy
    edited Dec 27, 2015 3:54AM

    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

  • Pavan Kumar
    Pavan Kumar Member Posts: 11,904 Gold Crown
    edited Dec 27, 2015 3:55AM

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

    [[email protected] Desktop]# ## fresh session

    [[email protected] Desktop]# su - oracle

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

    [[email protected] ~]$ 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"

    [[email protected] ~]$ ## Your source of settings

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

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

    works fine for me

    - Pavan Kumar N

  • Ujjwal Rana
    Ujjwal Rana Member Posts: 273
    edited Dec 27, 2015 3:58AM

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

    [[email protected] Desktop]$ echo $ORACLE_BASE

    /u01/app/grid

    [[email protected] Desktop]$  echo $ORACLE_HOME

    /u01/app/11.2.0/grid

    [[email protected] Desktop]$

  • Ujjwal Rana
    Ujjwal Rana Member Posts: 273
    edited Dec 27, 2015 4:16AM

    Hi Pavan,

    As per your instruction this is what i did

    [[email protected] Desktop]$  su - root

    Password:

    [[email protected] ~]#  fresh session

    -bash: fresh: command not found

    [[email protected] ~]# fresh session

    -bash: fresh: command not found

    [[email protected] ~]# #fresh session

    [[email protected] ~]# su - oracle

    [[email protected] ~]$ cat demo1.sh

    cat: demo1.sh: No such file or directory

    [[email protected] ~]$ 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"

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

    [[email protected] ~]$ export ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

    [[email protected] ~]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1; export ORACLE_HOME

    [[email protected] ~]$ export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH; export PATH

    [[email protected] ~]$ which sqlplus

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

    [[email protected] ~]$ PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

    [[email protected] ~]$ export PATH

    [[email protected] ~]$ which sqlplus

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

    [[email protected] ~]$

    [[email protected] ~]$ 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

    [[email protected] ~]$

    [[email protected] Desktop]$ sqlplus / as sysdba

    bash: sqlplus: command not found

    [[email protected] Desktop]$

    NOT WORKING

  • Aman....
    Aman.... Member Posts: 22,913 Gold Crown
    edited Dec 27, 2015 4:15AM
    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 :-
    
    [[email protected] Desktop]$ sqlplus / as sysdba
    bash: sqlplus: command not found
    [[email protected] Desktop]$ asmca
    bash: asmca: command not found
    [[email protected] Desktop]$ lsnrctl status
    bash: lsnrctl: command not found
    [[email protected] Desktop]$
    
    [[email protected] 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
    
    [[email protected] ~]$  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....

  • Pavan Kumar
    Pavan Kumar Member Posts: 11,904 Gold Crown
    edited Dec 27, 2015 4:17AM

    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

  • Ujjwal Rana
    Ujjwal Rana Member Posts: 273
    edited Dec 27, 2015 4:19AM

    Right now this is what availalbe insidde /etc/oratab

    [[email protected] ~]#  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

  • Ujjwal Rana
    Ujjwal Rana Member Posts: 273
    edited Dec 27, 2015 4:21AM

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

This discussion has been closed.