Overview

The problem is observer during the final stages of the upgrade of the Grid Infrastructure:

root@host01(/app/oragrid)> $GI_HOME/rootupgrade.sh
Performing root user operation.

The following environment variables are set as:
  ORACLE_OWNER= oragrid
  ORACLE_HOME= /app/oragrid/12.2.0/grid_home

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y
  Copying oraenv to /usr/local/bin ...
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

Relinking oracle with rac_on option
Relinking rac_on failed

This problem can be for 2 main reasons:

In case you experience the first problem, try to close as many applications as you can and re-start the script.

In case of the second problem, investigate, the $GRID_HOME/install/relinkGrid.txt file and try to relink manually:

[root@lparaca install]# tail -10 relinkActions2018-01-21_12-17-23-PM.log
   chmod 600 /u01/app/oracle/grid_12201//bin/oracleO )

INFO:
mv /u01/app/oracle/grid_12201//rdbms/lib/oracle /u01/app/oracle/grid_12201//bin/oracle

INFO:
chmod 6751 /u01/app/oracle/grid_12201//bin/oracle

INFO: End output from spawned process.
INFO: ----------------------------------
[root@lparaca install]# pwd
/u01/app/oracle/grid_12201/in