Forum Stats

  • 3,726,784 Users
  • 2,245,255 Discussions
  • 7,852,389 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

COMMAND NOT FOUND - ORACLE GRID

Ujjwal Rana
Ujjwal Rana Member Posts: 273

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

«134

Answers

  • Pavan Kumar
    Pavan Kumar Member Posts: 11,903 Gold Crown
    edited December 2015

    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 December 2015

    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,772 Gold Trophy
    edited December 2015

    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,903 Gold Crown
    edited December 2015

    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 December 2015

    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 December 2015

    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 December 2015
    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,903 Gold Crown
    edited December 2015

    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 December 2015

    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 December 2015

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

  • Aman....
    Aman.... Member Posts: 22,913 Gold Crown
    edited December 2015
    Ujjwal Rana wrote:
    
    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
    

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

    Aman....

  • Pavan Kumar
    Pavan Kumar Member Posts: 11,903 Gold Crown
    edited December 2015

    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

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

  • Aman....
    Aman.... Member Posts: 22,913 Gold Crown
    edited December 2015

    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:
    
    [[email protected] ~]$ 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
    
    [[email protected] ~]$ . 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
    [[email protected] ~]$ sqlplus
    bash: sqlplus: command not found
    [[email protected] ~]$ . oraenv
    ORACLE_SID = [nosid] ? orcldb
    The Oracle base remains unchanged with value /u01/app/oracle
    [[email protected] ~]$ which sqlplus
    /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/sqlplus
    [[email protected] ~]$ 
    

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

    HTH

    Aman....

  • Ujjwal Rana
    Ujjwal Rana Member Posts: 273
    edited December 2015

    You might want to see this

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

  • Ujjwal Rana
    Ujjwal Rana Member Posts: 273
    edited December 2015

    [[email protected] Desktop]$ . oraenv

    ORACLE_SID = [+ASM] ? +ASM

    ORACLE_BASE environment variable is not being set since this

    information is not available for the current user ID grid.

    You can set ORACLE_BASE manually if it is required.

    [[email protected] Desktop]$

    AND THIS ONE TOO :-

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

    [[email protected] Desktop]$ echo $ORACLE_BASE

    /u01/app/grid

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

    bash: sqlplus: command not found

    [[email protected] Desktop]$

  • Aman....
    Aman.... Member Posts: 22,913 Gold Crown
    edited December 2015
    Ujjwal Rana wrote:
    
    [[email protected] Desktop]$ . oraenv
    ORACLE_SID = [+ASM] ? +ASM
    ORACLE_BASE environment variable is not being set since this
    information is not available for the current user ID grid.
    You can set ORACLE_BASE manually if it is required.
    [[email protected] Desktop]$
    

    Did you do the installation using this user-GRID or the Oracle user ?

    What happens when you manually set the parameters ORACLE_HOME and ORACLE_BASE?

    Aman....

  • Aman....
    Aman.... Member Posts: 22,913 Gold Crown
    edited December 2015
    Ujjwal Rana wrote:
    
    You might want to see this
    
    [[email protected] ~]$ 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>
    

    This tells nothing but only this that either you are trying to connect to a wrong SID or your DB is not yet started.

    Aman....

  • Ujjwal Rana
    Ujjwal Rana Member Posts: 273
    edited December 2015

    This is what it happens

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

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

    [[email protected] Desktop]$ echo $ORACLE_BASE

    /u01/app/grid

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

    bash: sqlplus: command not found

    [[email protected] Desktop]$ asmca

    bash: asmca: command not found

    [[email protected] Desktop]$ asmcmd

    bash: asmcmd: command not found

  • Aman....
    Aman.... Member Posts: 22,913 Gold Crown
    edited December 2015

    I didn't ask you to do this. I asked -one, have you done the installation of ASM using GRID user and two , what happens when you manually set both the environment variables. We can't see what you are doing so please follow what you are suggested to do.

    Aman....

  • Ujjwal Rana
    Ujjwal Rana Member Posts: 273
    edited December 2015

    yes i did the installation of ASM using GRID user. However i have paste the oraenv output for both grid and oracle user below. This time i have paste the output doing manually this time.

    ok for grid as per your advise i did it manually here is the oraenv output

    [[email protected] Desktop]$ . oraenv

    ORACLE_SID = [+ASM] ? +ASM

    ORACLE_BASE environment variable is not being set since this

    information is not available for the current user ID grid.

    You can set ORACLE_BASE manually if it is required.

    [[email protected] Desktop]$ export ORACLE_BASE=/u01/app/grid

    [[email protected] Desktop]$ echo $ORACLE_BASE

    /u01/app/grid

    [[email protected] Desktop]$

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

    bash: sqlplus: command not found

    And for oracle user here is the oraenv output

    [[email protected] ~]$ . oraenv

    ORACLE_SID = [orcl] ? orcl

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

    [[email protected] ~]$

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

    SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 27 15:57:26 2015

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

    Connected to an idle instance.

    SQL>

  • Ujjwal Rana
    Ujjwal Rana Member Posts: 273
    edited December 2015

    Hi Pavan,

    I have past the oraenv output for grid and oracle user on the last comment. Please advise.

  • Aman....
    Aman.... Member Posts: 22,913 Gold Crown
    edited December 2015

    Switch the user using su - grid. Then set both the environment variables ORACLE_BASE and ORACLE_HOME and show us the output. Do not  miss the dash(-) while switching to the GRID user.

    Also , show the output of

    ls -l $ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml
    


    Aman....

    Pavan Kumar
  • Ujjwal Rana
    Ujjwal Rana Member Posts: 273
    edited December 2015

    [[email protected] ~]$ su - grid

    Password:

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

    [[email protected] ~]$ export ORACLE_HOME=/u01/app/11.2.0/grid

    [[email protected] ~]$ ls -l $ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml

    ls: cannot access /u01/app/11.2.0/grid/inventory/ContentsXML/oraclehomeproperties.xml: Permission denied

    [[email protected] ~]$

  • Pavan Kumar
    Pavan Kumar Member Posts: 11,903 Gold Crown
    edited December 2015

    Hi,

    Does your asm is up and running ? ps -ef | grep pmon

    Check what Aman posted, a big doubt whether have you done installation correctly or not

    - Pavan Kumar N

  • Ujjwal Rana
    Ujjwal Rana Member Posts: 273
    edited December 2015

    It was working perfectly before.

    [[email protected] ~]$ ps -ef | grep pmon

    grid      6241  6058  0 16:12 pts/1    00:00:00 grep pmon

    [[email protected] ~]$

This discussion has been closed.