Here, I am discussing a simple scenario, when you got a RAC installed system, but don’t know path of GRID_HOME. Let’s find out how to get path of GRID_HOME.
1. When Cluster is up and running: When Cluster ware is up and running then it becomes easy for a remote DBA to find out the GRID_HOME path using below query.
login to system using either root, oracle or gird user and execute.
-bash-4.1$ ps -ef | grep d.bin
oracle 1515 1 0 Mar 30 ? 173:36 /u01/app/22.214.171.124/grid/bin/evmd.bin
oracle 1202 1 0 Mar 30 ? 82:25 /u01/app/126.96.36.199/grid/bin/ocssd.bin
root 892 1 0 Mar 30 ? 46:00 /u01/app/188.8.131.52/grid/bin/ohasd.bin reboot
oracle 1011 1 0 Mar 30 ? 0:36 /u01/app/184.108.40.206/grid/bin/mdnsd.bin
oracle 994 1 0 Mar 30 ? 56:48 /u01/app/220.127.116.11/grid/bin/oraagent.bin
root 1200 1 0 Mar 30 ? 18:36 /u01/app/18.104.22.168/grid/bin/cssdagent
root 1181 1 0 Mar 30 ? 17:51 /u01/app/22.214.171.124/grid/bin/cssdmonitor
oracle 1080 1 0 Mar 30 ? 8:53 /u01/app/126.96.36.199/grid/bin/gpnpd.bin
oracle 1115 1 0 Mar 30 ? 91:02 /u01/app/188.8.131.52/grid/bin/gipcd.bin
root 1147 1 0 Mar 30 ? 295:00 /u01/app/184.108.40.206/grid/bin/osysmond.bin
root 1478 1 0 Mar 30 ? 173:46 /u01/app/220.127.116.11/grid/bin/octssd.bin reboot
root 1112 1 0 Mar 30 ? 21:00 /u01/app/18.104.22.168/grid/bin/orarootagent.bin
root 2202 1 0 Mar 30 ? 416:31 /u01/app/22.214.171.124/grid/bin/orarootagent.bin
oracle 2167 1 0 Mar 30 ? 144:26 /u01/app/126.96.36.199/grid/bin/oraagent.bin
I have listed few of the process only, From the above list you can easily see “/u01/app/188.8.131.52/grid” is GRID_HOME on this system. Set GRID_HOME and ready for remote DBA activities.
-bash-4.1$ export GRID_HOME=/u01/app/184.108.40.206/grid
-bash-4.1$ cd $GRID_HOME/bin
2. When Cluster is not up and Running: What if Cluster is not up and running. In this case, we need to check few locations for GRID_HOME location.
Check Profile or bash_profile File:
Let’s start from .profile (Solaris) or .bash_profile (Linux) file. Usually, Oracle environment variables like ORACLE_HOME and GRID_HOME and defined by remote DBA’s in to these files using either oracle or grid user. To find GRID_HOME go to home path using
-bash-4.1$ cd ~
-bash-4.1$ ls -a
In Solaris there is .profile and in Linux this will be .bash_profile file. Cat these files, you might get GRID_HOME variable defined in these files.
-bash-4.1$ cat .profile
In this case, GRID_HOME is not defined in profile file. Let’s look at other options.
Check oratab file:
oratab file is another file, where home_name with database instances are registered, when any database or ASM instance is created it’s name with Home Name are registered in oratab file. Let’s see if it helps.
In Linux path is “/etc/oratab” in Solaris “/var/opt/oracle/oratab”
-bash-4.1$ cat /var/opt/oracle/oratab
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.
# 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:
# 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.
+ASM1:/u01/app/220.127.116.11/grid:N # line added by Agent
db001:/u01/app/oracle/product/18.104.22.168/dbhome_1:N # line added by Agent
Here, we can see /u01/app/22.214.171.124/grid is path for GRID_HOME. Now, we are good to go with this.
Ora Inventory Location:
When, above also not work, a remote DBA can look into oraInventory location for installation logs. This is the location, where logs are created at time of Oracle S/W installations. So, we can find out GRID_HOME path in logs.
In Linux path is “/etc/oraInst.loc“ in Solaris “/var/opt/oracle/oraInst.loc”
-bash-4.1$ cat /var/opt/oracle/oraInst.loc
-bash-4.1$ cd /u01/app/oraInventory
backup ContentsXML logs oraInst.loc orainstRoot.sh oui
-bash-4.1$ cd logs/
-bash-4.1$ ls *out*
oraInstall2013-03-12_01-49-41PM.out oraInstall2013-03-12_02-45-12PM.out oraInstall2013-03-12_02-47-32PM.out oraInstall2013-03-12_01-49-41PM.out.db08 oraInstall2013-03-12_02-45-12PM.out.db08
Now, execute a grep command for grid on these scrips. like below
-bash-4.1$ cat oraInstall2013-03-12_01-49-41PM.out | grep grid
Execute /u01/app/126.96.36.199/grid/root.sh on the following nodes:
Please share your views about this article.