Saturday, June 24, 2017

Attaching an Oracle Grid Infrastructure Home to the inventory  

In Oracle RAC and Grid Infrastructure environments, keeping your Oracle Home properly registered and synchronized with the central inventory is key to stability and manageability. Recently, I had to reattach the Grid Home after a cloning process, and here's how it went down.

Let me walk you through the process — from script creation to confirmation via ASM. The Script: attach_grid_home.sh

Step 1  Create the script to attach the grid home 

 created a small shell script to automate the attachment using Oracle’s Universal Installer in silent mode.

cat attach_grid_home.sh

./runInstaller -silent -ignoreSysPrereqs -attachHome \
ORACLE_HOME="/omu01/app/12.1.0/grid" \
ORACLE_HOME_NAME="OraGI12Home1" \
LOCAL_NODE="omdb01" \
CLUSTER_NODES="{omdb01,omdb01}" \
CRS=true


oragrid @ omdb.domainname.com/omu01/app/12.1.0/grid/oui/bin >cat attach_grid_home.sh

./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/omu01/app/12.1.0/grid" ORACLE_HOME_NAME="OraGI12Home1" LOCAL_NODE="omdb01" CLUSTER_NODES="{omdb01,omdb01}" CRS=true
oragrid @ omdb01.domainname.com/omu01/app/12.1.0/grid/oui/bin >

Legends :

  • -silent: No GUI required

  • -attachHome: Command to attach an Oracle Home to inventory

  • ignoreSysPrereqs: Skips system requirement checks (safe in this case)

  • CRS=true: Marks this as a Clusterware (Grid Infra) installation

  • Oracle_home = Grid home location

  • Oracle_home_name =grid _home_name

  • Local_name= on which name you are running the script if you are running on node 1 then we need to specify the node1 or n node based on script is executed 

  • cluster_name= no of cluster names that is available in this cluster all the nodes need to be mentioned 

  • Crs == specify Whether CRS is true or not 

Step 2 Running the Script

Execution was simple:

sh attach_grid_home.sh
oragrid @ omdb01.domaonname.com/omu01/app/12.1.0/grid/oui/bin >sh attach_grid_home.sh
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 81920 MB    Passed
The inventory pointer is located at /var/opt/oracle/oraInst.loc
'AttachHome' was successful.

Here’s what I got:

Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 81920 MB    Passed
The inventory pointer is located at /var/opt/oracle/oraInst.loc
'AttachHome' was successful.

Success! Grid Infrastructure Home is now officially attached to Oracle’s inventory on the node omdb01.


Step 3 Verifying ASM Disk Groups

Once the Grid Home was attached, We need to  ensure that ASM was up and our disk groups were healthy. So,  we jumped into ASMCMD:

oragrid @ omdb01.domain.com/omu01/app/12.1.0/grid/oui/bin >



ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N        1024   4096  4194304   2516992   274832                0          274832              0             Y  DATA/
MOUNTED  EXTERN  N        1024   4096  4194304   1536000  1223924                0         1223924              0             N  FLASH/
MOUNTED  EXTERN  N        1024   4096  4194304   2048000  2047836                0         2047836              0             N  OMDATA/
MOUNTED  EXTERN  N        1024   4096  4194304    921600   921460                0          921460              0             N  OMFLASH/
ASMCMD>

All disk groups were mounted, externally mirrored, and had ample free space. Also, voting files were present on DATA/, which is expected in a RAC environment.

Key Takeaways

  • Attaching an Oracle Grid Home is straightforward with runInstaller -attachHome.

  • Silent installs save time, especially when you're managing multiple environments or automating cluster deployments.

  • Always validate the health of your ASM disk groups post-attachment using ASMCMD lsdg.

  • Proper configuration of the inventory pointer (/var/opt/oracle/oraInst.loc) is crucial.

Final Thoughts

Attaching a Grid Home might seem like a backend task, but it’s an essential part of maintaining a clean Oracle stack — especially when dealing with patching, upgrades, or cloned environments.

Whether you’re scripting it out or handling it manually, just a few lines and checks can ensure your cluster is well-registered and running smoothly.

Pro Tip: Automate and document everything. Today’s script is tomorrow’s lifesaver.

Need help scripting this for multiple nodes or automating across environments? Let me know — happy to share templates or guide you through it.

Until next time, happy clustering!