Changing the Oracle Grid Infrastructure Home Path

After installing Oracle Grid Infrastructure for a cluster (Oracle Clusterware and Oracle ASM configured for a cluster), if you need to change the Grid home path, then use the following example as a guide to detach the existing Grid home, and to attach a new Grid home:

Note:

Before changing the Grid home, you must shut down all executables that run in the Grid home directory that you are relinking. In addition, shut down applications linked with Oracle shared libraries.

  1. Log in as the Oracle Grid Infrastructure installation owner (grid).

  2. Change directory to Grid_home/bin and, as root, run the command crsctl stop crs. For example:

    $ cd /u01/app/19.0.0/grid/bin
    $ ./crsctl stop crs
    
  3. As grid user, detach the existing Grid home by running the following command, where /u01/app/19.0.0/grid is the existing Grid home location:

    $ /u01/app/19.0.0/grid/oui/bin/runInstaller -silent -waitforcompletion\
    -detachHome ORACLE_HOME='/u01/app/19.0.0/grid' -local
    
  4. As root, move the Grid binaries from the old Grid home location to the new Grid home location. For example, where the old Grid home is /u01/app/19.0.0/grid and the new Grid home is /u01/app/19c:

    # mkdir /u01/app/19c
    # cp -pR /u01/app/19.0.0/grid /u01/app/19c
    
  5. Unlock the destination Grid home:

    # cd /u01/app/19c/grid/crs/install
    # ./rootcrs.sh -unlock -dstcrshome /u01/app/19c/grid
  6. As grid, run the gridSetup.sh command from the new Grid home directory, and select the Configuration Option as Set Up Software Only:

    $ /u01/app/19c/grid/gridSetup.sh

    This step relinks the Oracle Grid Infrastructure binaries and updates the Oracle Inventory (oraInventory) with the new Oracle Grid Infrastructure home.

  7. As root again, enter the following command to start up in the new home location:

    # cd /u01/app/19c/grid/crs/install
    # ./rootcrs.sh -move -dstcrshome /u01/app/19c/grid
  8. Repeat steps 1 through 7 on each cluster member node.

Note:

While cloning, ensure that you do not change the Oracle home base, otherwise the move operation fails.